vpcom commited on
Commit
99d5d53
1 Parent(s): 603edc1

fix: if the response is str then handle it properly

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -600,7 +600,10 @@ def generate(
600
  #print('stream',response)
601
 
602
  if len(ENDPOINT)>0:
603
- output += response.generated_text if response.generated_text else ""
 
 
 
604
  else:
605
  output += response
606
 
 
600
  #print('stream',response)
601
 
602
  if len(ENDPOINT)>0:
603
+ if isinstance(response, str):
604
+ output += response if response else ""
605
+ else:
606
+ output += response.generated_text if response.generated_text else ""
607
  else:
608
  output += response
609