Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -61,3 +61,12 @@ tokenizer = AutoTokenizer.from_pretrained(
|
|
61 |
)
|
62 |
|
63 |
print("✅ مدل و توکنایزر با موفقیت بارگذاری شدند.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
)
|
62 |
|
63 |
print("✅ مدل و توکنایزر با موفقیت بارگذاری شدند.")
|
64 |
+
|
65 |
+
while True:
|
66 |
+
prompt = input("📝 یک دستور وارد کن (exit برای خروج): ")
|
67 |
+
if prompt.lower() == "exit":
|
68 |
+
break
|
69 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
70 |
+
outputs = model.generate(**inputs, max_new_tokens=200)
|
71 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
72 |
+
print("🧠 پاسخ:", response)
|