from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "yujiepan/qwen3-next-moe-tiny-random"# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype="auto",
device_map="cuda",
)
# prepare the model input
prompt = "Give me a short introduction to large language model."
messages = [
{"role": "user", "content": prompt},
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# conduct text completion
generated_ids = model.generate(
**model_inputs,
max_new_tokens=8,
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
content = tokenizer.decode(output_ids, skip_special_tokens=True)
print("content:", content)
Runs of yujiepan qwen3-next-moe-tiny-random on huggingface.co
1.5K
Total runs
0
24-hour runs
11
3-day runs
-136
7-day runs
-136
30-day runs
More Information About qwen3-next-moe-tiny-random huggingface.co Model
qwen3-next-moe-tiny-random huggingface.co
qwen3-next-moe-tiny-random huggingface.co is an AI model on huggingface.co that provides qwen3-next-moe-tiny-random's model effect (), which can be used instantly with this yujiepan qwen3-next-moe-tiny-random model. huggingface.co supports a free trial of the qwen3-next-moe-tiny-random model, and also provides paid use of the qwen3-next-moe-tiny-random. Support call qwen3-next-moe-tiny-random model through api, including Node.js, Python, http.
qwen3-next-moe-tiny-random huggingface.co is an online trial and call api platform, which integrates qwen3-next-moe-tiny-random's modeling effects, including api services, and provides a free online trial of qwen3-next-moe-tiny-random, you can try qwen3-next-moe-tiny-random online for free by clicking the link below.
yujiepan qwen3-next-moe-tiny-random online free url in huggingface.co:
qwen3-next-moe-tiny-random is an open source model from GitHub that offers a free installation service, and any user can find qwen3-next-moe-tiny-random on GitHub to install. At the same time, huggingface.co provides the effect of qwen3-next-moe-tiny-random install, users can directly use qwen3-next-moe-tiny-random installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
qwen3-next-moe-tiny-random install url in huggingface.co: