Spaces:
Configuration error

Jiangxz commited on
Commit
fbe0610
·
verified ·
1 Parent(s): 125dd3f

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -179,7 +179,6 @@ def process_image_and_text(image, text_input, Quick_Input, Language, model, api_
179
  model=model,
180
  temperature=1,
181
  )
182
- gr.Info("Vision 模型已完成回答。")
183
  return zhconv(chat_completion.choices[0].message.content.strip(), "zh-tw")
184
  except Exception as e:
185
  error_traceback = traceback.format_exc()
@@ -195,7 +194,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as iface:
195
  with gr.Row():
196
  with gr.Column(scale=1):
197
  image_input = gr.Image(type="pil", label="上傳圖片", elem_classes="image-background")
198
- model_select = gr.Dropdown(choices=MODELS, label="選擇 Vision 模型", value=MODELS[0], elem_classes="model-background")
199
  api_key = gr.Textbox(label="請輸入您的 API Key", type="password", placeholder="API authentication key", elem_classes="api-background")
200
  clear_button = gr.Button("清除回答及圖片", variant="secondary", elem_classes="clear-button")
201
  gr.Markdown("""
@@ -203,7 +202,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as iface:
203
  """, elem_classes="center-aligned")
204
 
205
  with gr.Column(scale=1):
206
- text_input = gr.Textbox(label="輸入問題", placeholder="請輸入您的問題...", autofocus=True, elem_classes="input-background", max_lines=5)
207
  with gr.Row():
208
  Quick_Input = gr.Dropdown(
209
  choices=["自行輸入", "描述圖片", "圖像推理", "圖片文字檢索"],
@@ -220,7 +219,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as iface:
220
  elem_classes="lng-background"
221
  )
222
  submit_button = gr.Button("傳送", variant="primary", elem_classes="gen-button")
223
- output = gr.Textbox(label="Vision 模型回答", elem_classes="script-background", max_lines=40)
224
 
225
  submit_button.click(
226
  fn=process_image_and_text,
 
179
  model=model,
180
  temperature=1,
181
  )
 
182
  return zhconv(chat_completion.choices[0].message.content.strip(), "zh-tw")
183
  except Exception as e:
184
  error_traceback = traceback.format_exc()
 
194
  with gr.Row():
195
  with gr.Column(scale=1):
196
  image_input = gr.Image(type="pil", label="上傳圖片", elem_classes="image-background")
197
+ model_select = gr.Dropdown(choices=MODELS, label="選擇態模型", value=MODELS[0], elem_classes="model-background")
198
  api_key = gr.Textbox(label="請輸入您的 API Key", type="password", placeholder="API authentication key", elem_classes="api-background")
199
  clear_button = gr.Button("清除回答及圖片", variant="secondary", elem_classes="clear-button")
200
  gr.Markdown("""
 
202
  """, elem_classes="center-aligned")
203
 
204
  with gr.Column(scale=1):
205
+ text_input = gr.Textbox(label="輸入您的問題", placeholder="Enter your question ...", autofocus=True, elem_classes="input-background", max_lines=5)
206
  with gr.Row():
207
  Quick_Input = gr.Dropdown(
208
  choices=["自行輸入", "描述圖片", "圖像推理", "圖片文字檢索"],
 
219
  elem_classes="lng-background"
220
  )
221
  submit_button = gr.Button("傳送", variant="primary", elem_classes="gen-button")
222
+ output = gr.Textbox(label="模型推理分析結果", elem_classes="script-background", max_lines=40)
223
 
224
  submit_button.click(
225
  fn=process_image_and_text,