Instructions to use lab-ii/TinyLlama-Sakha-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lab-ii/TinyLlama-Sakha-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lab-ii/TinyLlama-Sakha-Instruct")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lab-ii/TinyLlama-Sakha-Instruct") model = AutoModelForCausalLM.from_pretrained("lab-ii/TinyLlama-Sakha-Instruct") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use lab-ii/TinyLlama-Sakha-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lab-ii/TinyLlama-Sakha-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lab-ii/TinyLlama-Sakha-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/lab-ii/TinyLlama-Sakha-Instruct
- SGLang
How to use lab-ii/TinyLlama-Sakha-Instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "lab-ii/TinyLlama-Sakha-Instruct" \ --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": "lab-ii/TinyLlama-Sakha-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
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 "lab-ii/TinyLlama-Sakha-Instruct" \ --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": "lab-ii/TinyLlama-Sakha-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use lab-ii/TinyLlama-Sakha-Instruct with Docker Model Runner:
docker model run hf.co/lab-ii/TinyLlama-Sakha-Instruct
This Model
This is the chat model continue-pretrain and after sft on top of TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T.
How to use
You will need the transformers>=4.34 Do check the TinyLlama github page for more information.
# Install transformers from source - only needed for versions <= v4.34
# pip install git+https://github.com/huggingface/transformers.git
# pip install accelerate
import torch
from transformers import pipeline
pipe = pipeline("text-generation", model="lab-ii/TinyLlama-Sakha-Instruct", torch_dtype=torch.bfloat16, device_map="auto")
prompt_input = (
"Below is an instruction that describes a task. "
"Write a response that appropriately completes the request.\n\n"
"### Instruction:\n\n{instruction}\n\n### Response:\n\n"
)
raw_input_text = "Доруобай буолар кына үс сүбэни биэр"
promnt = generate_prompt(instruction=raw_input_text)
outputs = pipe(promnt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Доруобай буолар кына үс сүбэни биэр
### Response:
1. Аһылыккын тутус уонна элбэх фруктаны уонна хортуоппуйу сиэ.
2. Этиҥ-сииниҥ көхтөөх уонна күүстээх буоларын туһугар өрүү дьарыктан.
3. Ситэри утуй уонна биир тэҥ утуйар графигы тутус.
- Downloads last month
- 4