Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -294,19 +294,18 @@ def generate(text, history, rag_option, model_option, temperature=0.5, max_new_
|
|
294 |
#inference allg:
|
295 |
data = {
|
296 |
"inputs": prompt,
|
297 |
-
|
298 |
}
|
299 |
response= requests.post(API_URL, headers=HEADERS, json=data)
|
300 |
result = response.json()
|
301 |
print("result:------------------")
|
302 |
-
print(result)
|
303 |
chatbot_response = result[0]['generated_text']
|
304 |
print(chatbot_response)
|
305 |
except Exception as e:
|
306 |
raise gr.Error(e)
|
307 |
|
308 |
chatbot_message = chatbot_response[len(prompt):].strip()
|
309 |
-
return chatbot_message
|
310 |
|
311 |
#Antwort als Stream ausgeben...
|
312 |
#for i in range(len(result)):
|
|
|
294 |
#inference allg:
|
295 |
data = {
|
296 |
"inputs": prompt,
|
297 |
+
"options": {"max_new_tokens": 1024},
|
298 |
}
|
299 |
response= requests.post(API_URL, headers=HEADERS, json=data)
|
300 |
result = response.json()
|
301 |
print("result:------------------")
|
|
|
302 |
chatbot_response = result[0]['generated_text']
|
303 |
print(chatbot_response)
|
304 |
except Exception as e:
|
305 |
raise gr.Error(e)
|
306 |
|
307 |
chatbot_message = chatbot_response[len(prompt):].strip()
|
308 |
+
return chatbot_message
|
309 |
|
310 |
#Antwort als Stream ausgeben...
|
311 |
#for i in range(len(result)):
|