FinetuneAr / app.py
khodour's picture
Update app.py
5d60b9f verified
raw
history blame contribute delete
569 Bytes
import torch
from transformers import pipeline
pipe = pipeline(
"text-generation",
model="silma-ai/SILMA-9B-Instruct-v1.0",
model_kwargs={"torch_dtype": torch.bfloat16},
device="cuda", # replace with "mps" to run on a Mac device
)
messages = [
{"role": "user", "content": "ุงูƒุชุจ ุฑุณุงู„ุฉ ุชุนุชุฐุฑ ููŠู‡ุง ู„ู…ุฏูŠุฑูŠ ููŠ ุงู„ุนู…ู„ ุนู† ุงู„ุญุถูˆุฑ ุงู„ูŠูˆู… ู„ุฃุณุจุงุจ ู…ุฑุถูŠุฉ."},
]
outputs = pipe(messages, max_new_tokens=256)
assistant_response = outputs[0]["generated_text"][-1]["content"].strip()
print(assistant_response)