Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,12 +53,18 @@ Include the following structured components only:
|
|
| 53 |
"""
|
| 54 |
|
| 55 |
urdu_response = hf_client.text_generation(
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
# Create Word document
|
| 64 |
doc = Document()
|
|
|
|
| 53 |
"""
|
| 54 |
|
| 55 |
urdu_response = hf_client.text_generation(
|
| 56 |
+
model="MuhammadYaseen77999/urdu-islamic-bot",
|
| 57 |
+
prompt=prompt,
|
| 58 |
+
max_new_tokens=600,
|
| 59 |
+
temperature=0.7,
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
# Extract text properly
|
| 63 |
+
if isinstance(urdu_response, str):
|
| 64 |
+
lesson_text = urdu_response.strip()
|
| 65 |
+
else:
|
| 66 |
+
lesson_text = urdu_response.get("generated_text", "").strip()
|
| 67 |
+
|
| 68 |
|
| 69 |
# Create Word document
|
| 70 |
doc = Document()
|