optimum-intel-internal-testing / tiny-random-lfm2-moe

huggingface.co
Total runs: 5.6K
24-hour runs: 0
7-day runs: 3.0K
30-day runs: 2.7K
Model's Last Updated: March 19 2026

Introduction of tiny-random-lfm2-moe

Model Details of tiny-random-lfm2-moe

Here is a code to create this tiny model:


import os
import torch

from transformers import AutoTokenizer, AutoConfig, Lfm2MoeForCausalLM

# # === Step 1: Define tiny model config ===
model_id = "LiquidAI/LFM2-24B-A2B"
config = AutoConfig.from_pretrained(model_id)

config.num_hidden_layers = 3
config.layer_types = [
    "full_attention",
    "full_attention",
    "conv",
]
config.num_attention_heads = 4
config.num_key_value_heads = 4
config.hidden_size = 16
config.num_dense_layers = 1
config.moe_intermediate_size = 16
config.intermediate_size = 16

# === Step 2: Create model from config ===
model = Lfm2MoeForCausalLM(config)

# === Step 3: Load or create tokenizer ===
tokenizer = AutoTokenizer.from_pretrained(model_id)

# === Step 4: Save model and tokenizer ===
output_dir = "./lfm2_moe"
os.makedirs(output_dir, exist_ok=True)
model.save_pretrained(output_dir, safe_serialization=False)
tokenizer.save_pretrained(output_dir)

Runs of optimum-intel-internal-testing tiny-random-lfm2-moe on huggingface.co

5.6K
Total runs
0
24-hour runs
1.0K
3-day runs
3.0K
7-day runs
2.7K
30-day runs

More Information About tiny-random-lfm2-moe huggingface.co Model

More tiny-random-lfm2-moe license Visit here:

https://choosealicense.com/licenses/apache-2.0

tiny-random-lfm2-moe huggingface.co

tiny-random-lfm2-moe huggingface.co is an AI model on huggingface.co that provides tiny-random-lfm2-moe's model effect (), which can be used instantly with this optimum-intel-internal-testing tiny-random-lfm2-moe model. huggingface.co supports a free trial of the tiny-random-lfm2-moe model, and also provides paid use of the tiny-random-lfm2-moe. Support call tiny-random-lfm2-moe model through api, including Node.js, Python, http.

optimum-intel-internal-testing tiny-random-lfm2-moe online free

tiny-random-lfm2-moe huggingface.co is an online trial and call api platform, which integrates tiny-random-lfm2-moe's modeling effects, including api services, and provides a free online trial of tiny-random-lfm2-moe, you can try tiny-random-lfm2-moe online for free by clicking the link below.

optimum-intel-internal-testing tiny-random-lfm2-moe online free url in huggingface.co:

https://huggingface.co/optimum-intel-internal-testing/tiny-random-lfm2-moe

tiny-random-lfm2-moe install

tiny-random-lfm2-moe is an open source model from GitHub that offers a free installation service, and any user can find tiny-random-lfm2-moe on GitHub to install. At the same time, huggingface.co provides the effect of tiny-random-lfm2-moe install, users can directly use tiny-random-lfm2-moe installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

tiny-random-lfm2-moe install url in huggingface.co:

https://huggingface.co/optimum-intel-internal-testing/tiny-random-lfm2-moe

Url of tiny-random-lfm2-moe

Provider of tiny-random-lfm2-moe huggingface.co

optimum-intel-internal-testing
ORGANIZATIONS

Other API from optimum-intel-internal-testing