Downloads · 30 days
8
0% of all-time downloads
yahavb/Mistral-7B-Instruct-v0-3-neuron
Mistral-7B-Instruct-v0-3-neuron is a machine learning model from yahavb. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
8
0% of all-time downloads
All-time downloads
4K
Public
Repo size
97.1 MB
Likes
0
Public
Click a slice to open those files.
.neff97.1 MB · 100%
From the Hugging Face model README
from optimum.neuron import NeuronModelForCausalLM
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
tokenizer.pad_token_id = tokenizer.eos_token_id if tokenizer.pad_token_id is None else tokenizer.pad_token_id
model = NeuronModelForCausalLM.from_pretrained("yahavb/Mistral-7B-Instruct-v0-3-neuron", use_cache=True)
inputs = tokenizer("how is the weather in paris", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=50, do_sample=True, use_cache=True, temperature=0.7, top_k=50, top_p=0.9)
outputs = outputs[0, inputs.input_ids.size(-1):]
response = tokenizer.decode(outputs, skip_special_tokens=True)
print(response)