Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,13 +48,11 @@ def generate_text(user_text):
|
|
| 48 |
{"role": "user", "content": user_text},
|
| 49 |
|
| 50 |
]
|
| 51 |
-
plain_text =
|
| 52 |
-
|
| 53 |
-
if not plain_text.strip():
|
| 54 |
-
raise ValueError("Generated text for Hugging Face model is invalid!")
|
| 55 |
-
|
| 56 |
payload = {
|
| 57 |
-
"
|
|
|
|
| 58 |
"parameters": {
|
| 59 |
"temperature": 0.7,
|
| 60 |
"max_new_tokens": 1000,
|
|
|
|
| 48 |
{"role": "user", "content": user_text},
|
| 49 |
|
| 50 |
]
|
| 51 |
+
plain_text = json.dumps(messages)
|
| 52 |
+
print(plain_text)
|
|
|
|
|
|
|
|
|
|
| 53 |
payload = {
|
| 54 |
+
"model": "TheBloke/Mistral-7B-Instruct-v0.1-GGUF",
|
| 55 |
+
"inputs": plain_text,
|
| 56 |
"parameters": {
|
| 57 |
"temperature": 0.7,
|
| 58 |
"max_new_tokens": 1000,
|