from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model = AutoModelForCausalLM.from_pretrained("Vikhrmodels/Vikhr-7B-instruct_0.3",
device_map="auto",
attn_implementation="flash_attention_2",
torch_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained("Vikhrmodels/Vikhr-7B-instruct_0.3",use_fast=False)
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=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95, eos_token_id=tokenizer.eos_token_id)
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)
Runs of Vikhrmodels Vikhr-7B-instruct_0.3 on huggingface.co
25
Total runs
0
24-hour runs
0
3-day runs
-2
7-day runs
-2
30-day runs
More Information About Vikhr-7B-instruct_0.3 huggingface.co Model
Vikhr-7B-instruct_0.3 huggingface.co
Vikhr-7B-instruct_0.3 huggingface.co is an AI model on huggingface.co that provides Vikhr-7B-instruct_0.3's model effect (), which can be used instantly with this Vikhrmodels Vikhr-7B-instruct_0.3 model. huggingface.co supports a free trial of the Vikhr-7B-instruct_0.3 model, and also provides paid use of the Vikhr-7B-instruct_0.3. Support call Vikhr-7B-instruct_0.3 model through api, including Node.js, Python, http.
Vikhr-7B-instruct_0.3 huggingface.co is an online trial and call api platform, which integrates Vikhr-7B-instruct_0.3's modeling effects, including api services, and provides a free online trial of Vikhr-7B-instruct_0.3, you can try Vikhr-7B-instruct_0.3 online for free by clicking the link below.
Vikhrmodels Vikhr-7B-instruct_0.3 online free url in huggingface.co:
Vikhr-7B-instruct_0.3 is an open source model from GitHub that offers a free installation service, and any user can find Vikhr-7B-instruct_0.3 on GitHub to install. At the same time, huggingface.co provides the effect of Vikhr-7B-instruct_0.3 install, users can directly use Vikhr-7B-instruct_0.3 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Vikhr-7B-instruct_0.3 install url in huggingface.co: