alexkueck commited on
Commit
6685ad6
1 Parent(s): a5a9a19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -466,6 +466,14 @@ def generate_text (prompt, chatbot, history, rag_option, model_option, openai_ap
466
  data = {"inputs": prompt, "options": {"max_new_tokens": max_new_tokens},}
467
  response = requests.post(API_URL_TEXT, headers=HEADERS, json=data)
468
  result = response.json()
 
 
 
 
 
 
 
 
469
 
470
 
471
 
 
466
  data = {"inputs": prompt, "options": {"max_new_tokens": max_new_tokens},}
467
  response = requests.post(API_URL_TEXT, headers=HEADERS, json=data)
468
  result = response.json()
469
+ chatbot_response = result[0]['generated_text']
470
+ print("anzahl tokens gesamt antwort:------------------")
471
+ print (len(chatbot_response.split()))
472
+ chatbot_message = chatbot_response[len(prompt):].strip()
473
+ print("history/chatbot_rsponse:--------------------------------")
474
+ print(history)
475
+ print(chatbot_message)
476
+ result = chatbot_message
477
 
478
 
479