Spaces:
Configuration error
Configuration error
Upload app.py
Browse files
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="選擇
|
| 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="
|
| 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="
|
| 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,
|