ailabykt/sakha-corpus-mono
Viewer • Updated • 232k • 38 • 2
How to use ailabykt/aLabAI-20B-A3B-instruct-1301-bf16 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ailabykt/aLabAI-20B-A3B-instruct-1301-bf16", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("ailabykt/aLabAI-20B-A3B-instruct-1301-bf16", trust_remote_code=True, dtype="auto")How to use ailabykt/aLabAI-20B-A3B-instruct-1301-bf16 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ailabykt/aLabAI-20B-A3B-instruct-1301-bf16"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ailabykt/aLabAI-20B-A3B-instruct-1301-bf16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/ailabykt/aLabAI-20B-A3B-instruct-1301-bf16
How to use ailabykt/aLabAI-20B-A3B-instruct-1301-bf16 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ailabykt/aLabAI-20B-A3B-instruct-1301-bf16" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ailabykt/aLabAI-20B-A3B-instruct-1301-bf16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "ailabykt/aLabAI-20B-A3B-instruct-1301-bf16" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ailabykt/aLabAI-20B-A3B-instruct-1301-bf16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use ailabykt/aLabAI-20B-A3B-instruct-1301-bf16 with Docker Model Runner:
docker model run hf.co/ailabykt/aLabAI-20B-A3B-instruct-1301-bf16
Диалоговая модель с поддержкой якутского языка, основанная на GigaChat-20B-A3B-instruct.
transformers>=4.47import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
model_name = "ailabykt/aLabAI-20B-A3B-instruct-1301-bf16"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map="auto")
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)
В aLabAI-20B-A3B-instruct-1301-bf16, как и в оригинальной модели, используется особый способ токенизации текста, поэтому не рекомендуется следующий сценарий
input_string = tokenizer.apply_chat_template(messages,tokenize=False, add_generation_prompt=True)
input_tensor = tokenizer(input_string, return_tensors="pt")
Base model
ai-sage/GigaChat-20B-A3B-base