richardr1126 commited on
Commit
5d1c407
·
1 Parent(s): 3247c3a

Handle multiple reutrn sequences

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -173,6 +173,9 @@ def generate(input_message: str, db_info="", temperature=0.2, top_p=0.9, top_k=0
173
  response_text = response_text.split("### Response:")[1].strip()
174
 
175
  formatted_text = format(response_text) if format_sql else response_text
 
 
 
176
  responses.append(formatted_text)
177
 
178
  # Concat responses to be a single string seperated by a newline
 
173
  response_text = response_text.split("### Response:")[1].strip()
174
 
175
  formatted_text = format(response_text) if format_sql else response_text
176
+ if (num_return_sequences > 1):
177
+ formatted_text = formatted_text.replace("\n", "").replace("\t", "").strip()
178
+
179
  responses.append(formatted_text)
180
 
181
  # Concat responses to be a single string seperated by a newline