johann22 commited on
Commit
bbffc91
·
1 Parent(s): 6ca0772

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -124,13 +124,13 @@ def run_idefics(in_prompt,history,image,model_drop,seed):
124
  content = "User: What is in this image?![](https://upload.wikimedia.org/wikipedia/commons/8/86/Id%C3%A9fix.JPG)<end_of_utterance>\nAssistant:"
125
 
126
  print(content)
127
- stream = client.text_generation(content, **generation_args, stream=True, details=True, return_full_text=False)
128
  #stream = client.text_generation(content, **generate_kwargs, stream=True, details=True, return_full_text=False)
129
- resp = ""
130
- for response in stream:
131
- resp += response.token.text
132
- print (resp)
133
- return resp
134
 
135
 
136
  def generate(purpose,history,chat_drop,seed):
 
124
  content = "User: What is in this image?![](https://upload.wikimedia.org/wikipedia/commons/8/86/Id%C3%A9fix.JPG)<end_of_utterance>\nAssistant:"
125
 
126
  print(content)
127
+ stream = client.text_generation(content, **generation_args, stream=False)
128
  #stream = client.text_generation(content, **generate_kwargs, stream=True, details=True, return_full_text=False)
129
+ #resp = ""
130
+ #for response in stream:
131
+ # resp += response.token.text
132
+ print (stream)
133
+ return stream
134
 
135
 
136
  def generate(purpose,history,chat_drop,seed):