Tonic commited on
Commit
70358c4
1 Parent(s): 0cde323

Update maker.py

Browse files
Files changed (1) hide show
  1. maker.py +7 -7
maker.py CHANGED
@@ -91,17 +91,17 @@ def predict_beta(message, chatbot=[], system_prompt=system_prompt, max_new_token
91
  fn_index=0
92
  )
93
  print("Raw API Response:", result) # Debugging print
94
- if result is not None and len(result) > 0:
95
- bot_message = result[0]
96
- print("Processed bot_message:", bot_message) # Debugging print
97
- return bot_message
98
  else:
99
- raise gr.Error("No response received from the model.")
 
100
 
101
  except Exception as e:
102
  error_msg = f"An error occurred: {str(e)}"
103
- print("Error in predict_beta:", error_msg) # Debugging print
104
- raise gr.Error(error_msg)
105
 
106
  def extract_title_prompt_example(text):
107
  default_title = "Custom GPT Agent"
 
91
  fn_index=0
92
  )
93
  print("Raw API Response:", result) # Debugging print
94
+ if result is not None:
95
+ print("Processed bot_message:", result) # Debugging print
96
+ return result
 
97
  else:
98
+ print("No response or empty response from the model.") # Debugging print
99
+ return None
100
 
101
  except Exception as e:
102
  error_msg = f"An error occurred: {str(e)}"
103
+ print(error_msg) # Debugging print
104
+ return None
105
 
106
  def extract_title_prompt_example(text):
107
  default_title = "Custom GPT Agent"