mou3az commited on
Commit
038e998
1 Parent(s): f03bc12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -45,7 +45,9 @@ def handle_message(message: str, mode: str):
45
  else:
46
  result_text = "Select a valid mode."
47
 
48
- return result_text, result_image
 
 
49
 
50
  def chat_message(message: str):
51
  global messages
@@ -116,7 +118,7 @@ def chart_generator(message: str):
116
  demo = gr.Interface(
117
  fn=handle_message,
118
  inputs=["text", gr.Radio(["Chat-Message", "Web-Search", "Chart-Generator"], label="mode", info="Choose a mode and enter your message, then click submit to interact.")],
119
- outputs=[gr.Textbox(label="Response"), gr.Image(type="filepath")],
120
  title="IT Assistant")
121
 
122
  demo.launch()
 
45
  else:
46
  result_text = "Select a valid mode."
47
 
48
+ result_combined = f"Image URL: {result_image}\n\n{result_text}" if result_image else result_text
49
+
50
+ return result_combined
51
 
52
  def chat_message(message: str):
53
  global messages
 
118
  demo = gr.Interface(
119
  fn=handle_message,
120
  inputs=["text", gr.Radio(["Chat-Message", "Web-Search", "Chart-Generator"], label="mode", info="Choose a mode and enter your message, then click submit to interact.")],
121
+ outputs=gr.Textbox(label="Response"),
122
  title="IT Assistant")
123
 
124
  demo.launch()