alexkueck commited on
Commit
a0ba8d4
·
1 Parent(s): 8f3283d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -301,14 +301,15 @@ def generate(text, history, rag_option, model_option, temperature=0.5, max_new_
301
  #print("result:------------------")
302
  #print(result[0]['generated_text'])
303
  if response.status_code == 200:
304
- result = json.loads(response.text)["generated_text"]
305
  else:
306
  raise Exception(f"Request failed with status code {response.status_code}: {response.text}")
307
 
308
  except Exception as e:
309
  raise gr.Error(e)
310
 
311
- return result #result[0]['generated_text']
 
312
 
313
  #Antwort als Stream ausgeben...
314
  #for i in range(len(result)):
 
301
  #print("result:------------------")
302
  #print(result[0]['generated_text'])
303
  if response.status_code == 200:
304
+ chatbot_response = json.loads(response.text)["generated_text"]
305
  else:
306
  raise Exception(f"Request failed with status code {response.status_code}: {response.text}")
307
 
308
  except Exception as e:
309
  raise gr.Error(e)
310
 
311
+ chatbot_message = chatbot_response[len(prompt):].strip()
312
+ return chatbot_message #result[0]['generated_text']
313
 
314
  #Antwort als Stream ausgeben...
315
  #for i in range(len(result)):