Tigasturned commited on
Commit
2613062
1 Parent(s): 02c5f8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -14
app.py CHANGED
@@ -39,20 +39,6 @@ def respond(
39
  if not message or not isinstance(message, dict):
40
  continue
41
 
42
- try:
43
- # Extract content and finish reason
44
- content = message.choices[0].delta.content
45
- finish_reason = message.choices[0].finish_reason
46
-
47
- # Check if the content is empty
48
- if content.strip() == "":
49
- # If the finish reason is 'stop', it's expected and we can break the loop
50
- if finish_reason == "stop":
51
- print("Stream ended normally.")
52
- break
53
- else:
54
- print("Received unexpected empty content, skipping...")
55
- continue
56
 
57
  """
58
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
 
39
  if not message or not isinstance(message, dict):
40
  continue
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  """
44
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface