am commited on
Commit ·
f2960e2
1
Parent(s): 0e4df68
dsv5
Browse files
app.py
CHANGED
|
@@ -10,11 +10,13 @@ import spaces
|
|
| 10 |
import math
|
| 11 |
import os
|
| 12 |
|
| 13 |
-
from transformers import Qwen2_5_VLForConditionalGeneration
|
| 14 |
from qwen_vl_utils import process_vision_info, fetch_image
|
| 15 |
|
| 16 |
|
| 17 |
-
pretrained_model_name_or_path=os.environ.get("MODEL", "amrn/testmodel2")
|
|
|
|
|
|
|
| 18 |
auth_token = os.environ.get("HF_TOKEN") or True
|
| 19 |
DEFAULT_PROMPT = "Find abnormalities and support devices."
|
| 20 |
|
|
@@ -117,7 +119,7 @@ with gr.Blocks() as demo:
|
|
| 117 |
|
| 118 |
send_btn = gr.Button("Send", variant="primary", render=False)
|
| 119 |
textbox = gr.Textbox(show_label=False, placeholder="Enter your text here and press ENTER", render=False, submit_btn="Send")
|
| 120 |
-
chatbot = gr.Chatbot(type="messages", label="AI", render_markdown=True, sanitize_html=False, allow_tags=True, height=800, container=False, show_share_button=False)
|
| 121 |
|
| 122 |
with gr.Row():
|
| 123 |
with gr.Column(scale=4):
|
|
@@ -141,8 +143,8 @@ with gr.Blocks() as demo:
|
|
| 141 |
chat_interface = gr.ChatInterface(fn=model_inference,
|
| 142 |
# title='title', description='description',
|
| 143 |
type="messages",
|
| 144 |
-
chatbot=
|
| 145 |
-
textbox=textbox,
|
| 146 |
additional_inputs=image_input,
|
| 147 |
multimodal=False,
|
| 148 |
)
|
|
|
|
| 10 |
import math
|
| 11 |
import os
|
| 12 |
|
| 13 |
+
# from transformers import Qwen2_5_VLForConditionalGeneration
|
| 14 |
from qwen_vl_utils import process_vision_info, fetch_image
|
| 15 |
|
| 16 |
|
| 17 |
+
# pretrained_model_name_or_path=os.environ.get("MODEL", "amrn/testmodel2")
|
| 18 |
+
pretrained_model_name_or_path=os.environ.get("MODEL", "amrn/dsv5mx3")
|
| 19 |
+
|
| 20 |
auth_token = os.environ.get("HF_TOKEN") or True
|
| 21 |
DEFAULT_PROMPT = "Find abnormalities and support devices."
|
| 22 |
|
|
|
|
| 119 |
|
| 120 |
send_btn = gr.Button("Send", variant="primary", render=False)
|
| 121 |
textbox = gr.Textbox(show_label=False, placeholder="Enter your text here and press ENTER", render=False, submit_btn="Send")
|
| 122 |
+
# chatbot = gr.Chatbot(type="messages", label="AI", render_markdown=True, sanitize_html=False, allow_tags=True, height=800, container=False, show_share_button=False)
|
| 123 |
|
| 124 |
with gr.Row():
|
| 125 |
with gr.Column(scale=4):
|
|
|
|
| 143 |
chat_interface = gr.ChatInterface(fn=model_inference,
|
| 144 |
# title='title', description='description',
|
| 145 |
type="messages",
|
| 146 |
+
chatbot=gr.Chatbot(type="messages", label="AI", render_markdown=True, sanitize_html=False, allow_tags=True, height=800, container=False, show_share_button=False)
|
| 147 |
+
, textbox=textbox,
|
| 148 |
additional_inputs=image_input,
|
| 149 |
multimodal=False,
|
| 150 |
)
|