from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model = AutoModelForCausalLM.from_pretrained("Vikhrmodels/it-5.2-fp16-cp",
device_map="auto",
attn_implementation="sdpa",
torch_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained("Vikhrmodels/it-5.2-fp16-cp")
from transformers import AutoTokenizer, pipeline
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
prompts = [
"В чем разница между фруктом и овощем?",
"Годы жизни колмагорова?"]
deftest_inference(prompt):
prompt = pipe.tokenizer.apply_chat_template([{"role": "user", "content": prompt}], tokenize=False, add_generation_prompt=True)
print(prompt)
outputs = pipe(prompt, max_new_tokens=512, do_sample=True, num_beams=1, temperature=0.25, top_k=50, top_p=0.98, eos_token_id=79097)
return outputs[0]['generated_text'][len(prompt):].strip()
for prompt in prompts:
print(f" prompt:\n{prompt}")
print(f" response:\n{test_inference(prompt)}")
print("-"*50)
@article{nikolich2024vikhr,
title={Vikhr: The Family of Open-Source Instruction-Tuned Large Language Models for Russian},
author={Aleksandr Nikolich and Konstantin Korolev and Artem Shelmanov},
journal={arXiv preprint arXiv:2405.13929},
year={2024},
url={https://arxiv.org/pdf/2405.13929}
}
Runs of Vikhrmodels it-5.2-fp16-cp on huggingface.co
15.3K
Total runs
0
24-hour runs
0
3-day runs
1.1K
7-day runs
-3.2K
30-day runs
More Information About it-5.2-fp16-cp huggingface.co Model
it-5.2-fp16-cp huggingface.co is an AI model on huggingface.co that provides it-5.2-fp16-cp's model effect (), which can be used instantly with this Vikhrmodels it-5.2-fp16-cp model. huggingface.co supports a free trial of the it-5.2-fp16-cp model, and also provides paid use of the it-5.2-fp16-cp. Support call it-5.2-fp16-cp model through api, including Node.js, Python, http.
it-5.2-fp16-cp huggingface.co is an online trial and call api platform, which integrates it-5.2-fp16-cp's modeling effects, including api services, and provides a free online trial of it-5.2-fp16-cp, you can try it-5.2-fp16-cp online for free by clicking the link below.
Vikhrmodels it-5.2-fp16-cp online free url in huggingface.co:
it-5.2-fp16-cp is an open source model from GitHub that offers a free installation service, and any user can find it-5.2-fp16-cp on GitHub to install. At the same time, huggingface.co provides the effect of it-5.2-fp16-cp install, users can directly use it-5.2-fp16-cp installed effect in huggingface.co for debugging and trial. It also supports api for free installation.