Downloads · 30 days
0
evilfreelancer/GigaChat-20B-A3B-instruct-bf16-GGUF
GigaChat-20B-A3B-instruct-bf16-GGUF is a machine learning model from evilfreelancer. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Диалоговая модель из семейства моделей GigaChat, основная на ai-sage/GigaChat-20B-A3B-instruct. Поддерживает контекст в 131 тысячу токенов.
Downloads · 30 days
0
Access
Public
Updated Jan 16, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md1.6 KB · 51%
From the Hugging Face model README
Диалоговая модель из семейства моделей GigaChat, основная на ai-sage/GigaChat-20B-A3B-instruct. Поддерживает контекст в 131 тысячу токенов.
Больше подробностей в хабр статье и в карточке оригинальной instruct модели.
pip install --upgrade transformers torch accelerate bitsandbytes
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
model_name = "ai-sage/GigaChat-20B-A3B-instruct-bf16"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True, device_map="auto", torch_dtype=torch.bfloat16)
model.generation_config = GenerationConfig.from_pretrained(model_name)
messages = [
{"role": "user", "content": "Докажи теорему о неподвижной точке"}
]
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(input_tensor.to(model.device))
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=False)
print(result)