Downloads · 30 days
0
trottdw/CE104FinalLlama3Orca
CE104FinalLlama3Orca is a text generation model from trottdw. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
This model was trained using AutoTrain. For more information, please visit AutoTrain.
Downloads · 30 days
0
Access
Public
Updated May 1, 2024
Repo size
168 MB
Likes
0
Public
Click a slice to open those files.
.safetensors168 MB · 95%
From the Hugging Face model README
This model was trained using AutoTrain. For more information, please visit AutoTrain.
from transformers import (
AutoConfig,
AutoModelForCausalLM,
AutoTokenizer,
Trainer,
BitsAndBytesConfig,
)
from peft import PeftModel, PeftConfig
config = PeftConfig.from_pretrained("trottdw/CE104FinalLlama3Orca")
model = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B")
model = model.to('cuda:0')
lora_model = PeftModel.from_pretrained(model, "trottdw/CE104FinalLlama3Orca")
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B", use_fast=True
def prompt(text, tmp):
model_inputs = tokenizer(text, return_tensors="pt").to("cuda:0")
output = lora_model.generate(**model_inputs, temperature=tmp)
return print(tokenizer.decode(output[0], skip_special_tokens=True))
print(prompt('Describe the solar system',0.7))