How can i run this model?

#1
by Python2231 - opened

Could you please guide me through running this? I’m new to Unsloth, so I’d appreciate it if you could explain the process. Also, if you could share the data you used for training and the accuracy achieved, that would be very helpful. Thanks!

found out you can run it like this but it is somali doesnt make sanse

"from unsloth import FastLanguageModel

max_seq_len = 1024
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="adityaedy01/llama3-somali1",
max_seq_length=max_seq_len,
dtype=None
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference

prompt_tempate = """Hoos waxaa ku qoran tilmaamo sharxaya hawl, oo lagu lammaaneeyay wax gelin siiya macluumaad dheeraad ah. Qor jawaab si habboon u dhamaystiraysa codsiga.

Tilmaamo:

{}

Wax gelin:

{}

Jawaab:

"""

def generate_output(instruction, user_input):
input_ids = tokenizer(
[
prompt_tempate.format(instruction, user_input)
], return_tensors="pt").to("cuda")

outputs = model.generate(**input_ids, max_length=max_seq_len, do_sample=True)

# removes prompt, comment this out if you want to see it.
outputs = [output[len(input_ids[i].ids):] for i, output in enumerate(outputs)]

return tokenizer.decode(outputs[0], skip_special_tokens=True)

response = generate_output("Maxaa aad u samayn kartaa?", "")
print(response)"

Sign up or log in to comment