glm-moe-dsa-tiny-random
261
—
by
yujiepan
Language Model
OTHER
5B params
New
261 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
12GB+ RAM
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Device Compatibility
Mobile
4-6GB RAM
Laptop
16GB RAM
Server
GPU
Minimum Recommended
5GB+ RAM
Code Examples
messages = [{"role": "user", "content": "hello"}]pythontransformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "yujiepan/glm-moe-dsa-tiny-random"
tokenizer = AutoTokenizer.from_pretrained(model_id)
input_ids = torch.randint(1000, 2000, size=(1, 2333), dtype=torch.long).cuda() # trigger DSA
# messages = [{"role": "user", "content": "hello"}]
# input_ids = tokenizer(messages, return_tensors="pt").input_ids.cuda()
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="cuda",
)
generated_ids = model.generate(input_ids, max_new_tokens=32)
output_text = tokenizer.decode(generated_ids[0][input_ids.shape[1]:])
print(output_text)Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.