Samuel L Meyers commited on
Commit
3071687
·
1 Parent(s): f0247b1

Adjust text retrieval

Browse files
Files changed (1) hide show
  1. code/app.py +2 -5
code/app.py CHANGED
@@ -78,11 +78,8 @@ def talk(txt, jsn):
78
  for r in result:
79
  print("GOT RESULT:", r)
80
  txt2 = None
81
- if "text" in r["choices"][0]:
82
- txt2 = r["choices"][0]["text"]
83
- elif not "text" in r["choices"][0] and not "role" in r["choices"][0]:
84
- running = False
85
- yield txt
86
  if txt2 is not None:
87
  txt3 = txt
88
  txt = stowchunk(txt, txt2)
 
78
  for r in result:
79
  print("GOT RESULT:", r)
80
  txt2 = None
81
+ if r != None and r != "":
82
+ txt2 = r
 
 
 
83
  if txt2 is not None:
84
  txt3 = txt
85
  txt = stowchunk(txt, txt2)