KingNish commited on
Commit
6417a68
·
verified ·
1 Parent(s): 2a61378

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -175,8 +175,7 @@ def text_to_image(prompt, show_thinking=False, cfg_text_scale=4.0, cfg_interval=
175
  image_shapes=image_shapes,
176
  )
177
 
178
- result = {}
179
-
180
  # Call inferencer with or without think parameter based on user choice
181
  for i in inferencer(text=prompt, think=show_thinking, **inference_hyper):
182
  if type(i) == str:
@@ -206,7 +205,7 @@ def image_understanding(image: Image.Image, prompt: str, show_thinking=False,
206
  max_think_token_n=max_new_tokens, # Set max_length
207
  )
208
 
209
- result = {}
210
  # Use show_thinking parameter to control thinking process
211
  for i in inferencer(image=image, text=prompt, think=show_thinking,
212
  understanding_output=True, **inference_hyper):
@@ -250,7 +249,7 @@ def edit_image(image: Image.Image, prompt: str, show_thinking=False, cfg_text_sc
250
  )
251
 
252
  # Include thinking parameter based on user choice
253
- result = {}
254
  for i in inferencer(image=image, text=prompt, think=show_thinking, **inference_hyper):
255
  if type(i) == str:
256
  result["text"] += i
 
175
  image_shapes=image_shapes,
176
  )
177
 
178
+ result = {"text": ""}
 
179
  # Call inferencer with or without think parameter based on user choice
180
  for i in inferencer(text=prompt, think=show_thinking, **inference_hyper):
181
  if type(i) == str:
 
205
  max_think_token_n=max_new_tokens, # Set max_length
206
  )
207
 
208
+ result = {"text": ""}
209
  # Use show_thinking parameter to control thinking process
210
  for i in inferencer(image=image, text=prompt, think=show_thinking,
211
  understanding_output=True, **inference_hyper):
 
249
  )
250
 
251
  # Include thinking parameter based on user choice
252
+ result = {"text": ""}
253
  for i in inferencer(image=image, text=prompt, think=show_thinking, **inference_hyper):
254
  if type(i) == str:
255
  result["text"] += i