Downloads · 30 days
14
0% of all-time downloads
TheAverageDetective/Llama-3.1-8B-Instruct-openvino
Llama-3.1-8B-Instruct-openvino is a text generation model from TheAverageDetective. Use it when you need the model to write or continue text. The card lists the license as llama3.1.
This model was converted to OpenVINO from meta-llama/Llama-3.1-8B-Instruct using optimum-intel via the export space.
Downloads · 30 days
14
0% of all-time downloads
All-time downloads
6.3K
Public
Repo size
8 GB
Likes
0
Public
Click a slice to open those files.
.bin8 GB · 100%
From the Hugging Face model README
This model was converted to OpenVINO from meta-llama/Llama-3.1-8B-Instruct using optimum-intel
via the export space.
Install packages:
pip install optimum[openvino] transformers torch
Sample code:
from optimum.intel import OVModelForCausalLM
from transformers import AutoTokenizer
model_id = "TheAverageDetective/Llama-3.1-8B-Instruct-openvino"
model = OVModelForCausalLM.from_pretrained(model_id, device="GPU")
tokenizer = AutoTokenizer.from_pretrained(model_id)
prompt = "Explain the theory of relativity in simple terms."
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt}
]
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(input_text, return_tensors="pt")
output_ids = model.generate(**inputs, max_new_tokens=150)
result = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0]
print("\n", result)