aixsatoshi commited on
Commit
929aae5
·
verified ·
1 Parent(s): 13669f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -69,7 +69,7 @@ def get_labels(language):
69
  # Gradioインターフェース
70
  def process_input(text, image_url):
71
  result = mistral_inference(text, image_url)
72
- return result, image_url
73
 
74
  def update_ui(language):
75
  labels = get_labels(language)
@@ -84,7 +84,7 @@ with gr.Blocks() as demo:
84
  image_input = gr.Textbox(label="Image URL", placeholder="e.g. https://example.com/image.png")
85
 
86
  result_output = gr.Textbox(label="Model Output", lines=8, max_lines=20) # 高さ500ピクセルに相当するように調整
87
- image_output = gr.Image(label="Input Image", type="auto") # 入力画像URLを表示するための場所
88
 
89
  submit_button = gr.Button("Run Inference")
90
 
 
69
  # Gradioインターフェース
70
  def process_input(text, image_url):
71
  result = mistral_inference(text, image_url)
72
+ return result, f'<img src="{image_url}" alt="Input Image" width="300">'
73
 
74
  def update_ui(language):
75
  labels = get_labels(language)
 
84
  image_input = gr.Textbox(label="Image URL", placeholder="e.g. https://example.com/image.png")
85
 
86
  result_output = gr.Textbox(label="Model Output", lines=8, max_lines=20) # 高さ500ピクセルに相当するように調整
87
+ image_output = gr.HTML(label="Input Image") # 入力画像URLを表示するための場所
88
 
89
  submit_button = gr.Button("Run Inference")
90