johann22 commited on
Commit
048d51f
β€’
1 Parent(s): 8a1ff97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -74,8 +74,8 @@ def run_gpt(
74
  for response in stream:
75
  resp += response.token.text
76
 
77
- history.append((in_prompt,resp))
78
- return history
79
 
80
 
81
  def run(purpose,history,model_drop):
@@ -89,7 +89,8 @@ def run(purpose,history,model_drop):
89
  #action_name, action_input = parse_action(line)
90
  out_prompt = run_gpt(purpose,history)
91
  #yield ([(purpose,out_prompt)],None)
92
- yield (out_prompt,None)
 
93
  #out_img = infer(out_prompt)
94
  model=loaded_model[int(model_drop)]
95
  out_img=model(out_prompt)
@@ -103,7 +104,7 @@ def run(purpose,history,model_drop):
103
  if r.status_code == 200:
104
  out = Image.open(io.BytesIO(r.content))
105
  #yield ([(purpose,out_prompt)],out)
106
- yield (out_prompt,out)
107
  else:
108
  yield ([(purpose,"an Error occured")],None)
109
 
 
74
  for response in stream:
75
  resp += response.token.text
76
 
77
+ #history.append((in_prompt,resp))
78
+ return resp
79
 
80
 
81
  def run(purpose,history,model_drop):
 
89
  #action_name, action_input = parse_action(line)
90
  out_prompt = run_gpt(purpose,history)
91
  #yield ([(purpose,out_prompt)],None)
92
+ history.append((purpose,out_prompt))
93
+ yield (history,None)
94
  #out_img = infer(out_prompt)
95
  model=loaded_model[int(model_drop)]
96
  out_img=model(out_prompt)
 
104
  if r.status_code == 200:
105
  out = Image.open(io.BytesIO(r.content))
106
  #yield ([(purpose,out_prompt)],out)
107
+ yield (history,out)
108
  else:
109
  yield ([(purpose,"an Error occured")],None)
110