Voiid-m commited on
Commit
f8dd3b6
·
verified ·
1 Parent(s): bccba98

Custom debug

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +6 -3
Gradio_UI.py CHANGED
@@ -25,6 +25,9 @@ from smolagents.agents import ActionStep, MultiStepAgent
25
  from smolagents.memory import MemoryStep
26
  from smolagents.utils import _is_package_available
27
 
 
 
 
28
 
29
  def pull_messages_from_step(
30
  step_log: MemoryStep,
@@ -185,9 +188,9 @@ def stream_to_gradio(
185
  # mais pour l’instant on laisse image_path = None.
186
 
187
  elif isinstance(final_answer, AgentImage):
188
- print("DEBUG AgentImage type:", type(final_answer))
189
- print("DEBUG AgentImage to_string:", final_answer.to_string())
190
- print("DEBUG AgentImage to_raw:", type(final_answer.to_raw()))
191
  # On convertit l'AgentImage en fichier sur disque
192
  image_path = save_agent_image_to_tmp(final_answer)
193
 
 
25
  from smolagents.memory import MemoryStep
26
  from smolagents.utils import _is_package_available
27
 
28
+ def debug_print(x):
29
+ print("DEBUG_FROM_GRADIO:", x)
30
+ return x
31
 
32
  def pull_messages_from_step(
33
  step_log: MemoryStep,
 
188
  # mais pour l’instant on laisse image_path = None.
189
 
190
  elif isinstance(final_answer, AgentImage):
191
+ debug_print("DEBUG AgentImage type:", type(final_answer))
192
+ debug_print("DEBUG AgentImage to_string:", final_answer.to_string())
193
+ debug_print("DEBUG AgentImage to_raw:", type(final_answer.to_raw()))
194
  # On convertit l'AgentImage en fichier sur disque
195
  image_path = save_agent_image_to_tmp(final_answer)
196