Downloads · 30 days
26
0% of all-time downloads
Crystalcareai/GemMoE-Medium-V0.5
GemMoE-Medium-V0.5 is a text generation model from Crystalcareai. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
26
0% of all-time downloads
All-time downloads
11K
Public
Parameters
27.6B
55.1 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors55.1 GB · 100%
From the Hugging Face model README
import torch
from transformers import AutoTokenizer, TextStreamer, AutoModelForCausalLM
model_path = "Crystalcareai/GemMoE-Medium-v0.5"
# Load model
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="auto",
low_cpu_mem_usage=True,
torch_dtype=torch.float16,
attn_implementation="flash_attention_2",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(model_path)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
# Convert prompt to tokens
prompt_template = "[INST] {prompt} [/INST]"
prompt = "You're standing on the surface of the Earth. "\
"You walk one mile south, one mile west and one mile north. "\
"You end up exactly where you started. Where are you?"
tokens = tokenizer(
prompt_template.format(prompt=prompt),
return_tensors='pt'
).input_ids.cuda()
# Generate output
generation_output = model.generate(
tokens,
streamer=streamer,
max_new_tokens=512
)