Views
No views yet
1# Install transformers from source - only needed for versions <= v4.34
2# pip install git+https://github.com/huggingface/transformers.git
3# pip install accelerate
4import torch
5from transformers import pipeline
6pipe = pipeline("text-generation", model="lab-ii/TinyLlama-Sakha-Instruct", torch_dtype=torch.bfloat16, device_map="auto")
7prompt_input = (
8 "Below is an instruction that describes a task. "
9 "Write a response that appropriately completes the request.\n\n"
10 "### Instruction:\n\n{instruction}\n\n### Response:\n\n"
11)
12
13raw_input_text = "Доруобай буолар кына үс сүбэни биэр"
14promnt = generate_prompt(instruction=raw_input_text)
15outputs = pipe(promnt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
16print(outputs[0]["generated_text"])
17
18Below is an instruction that describes a task. Write a response that appropriately completes the request.
19
20### Instruction:
21
22Доруобай буолар кына үс сүбэни биэр
23
24### Response:
25
261. Аһылыккын тутус уонна элбэх фруктаны уонна хортуоппуйу сиэ.
272. Этиҥ-сииниҥ көхтөөх уонна күүстээх буоларын туһугар өрүү дьарыктан.
283. Ситэри утуй уонна биир тэҥ утуйар графигы тутус.