Spaces:
Runtime error
Runtime error
Commit
Β·
f9d3807
1
Parent(s):
87fc8c6
test input
Browse files
app.py
CHANGED
|
@@ -58,7 +58,7 @@ def rescale_bounding_boxes(bounding_boxes, original_width, original_height, scal
|
|
| 58 |
return rescaled_boxes
|
| 59 |
|
| 60 |
|
| 61 |
-
def deepseek(image):
|
| 62 |
print("helloe!!!!")
|
| 63 |
# specify the path to the model
|
| 64 |
model_path = "deepseek-ai/deepseek-vl2-tiny"
|
|
@@ -72,7 +72,7 @@ def deepseek(image):
|
|
| 72 |
conversation = [
|
| 73 |
{
|
| 74 |
"role": "<|User|>",
|
| 75 |
-
"content": "<image>\n<|ref|>
|
| 76 |
"images": ["./images/visual_grounding_1.jpeg"],
|
| 77 |
},
|
| 78 |
{"role": "<|Assistant|>", "content": ""},
|
|
@@ -176,7 +176,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 176 |
with gr.Row():
|
| 177 |
with gr.Column():
|
| 178 |
input_img = gr.Image(label="Input Image", type="pil")
|
| 179 |
-
model_selector = gr.Dropdown(choices=list(models.keys()), label="Model", value="
|
| 180 |
text_input = gr.Textbox(label="User Prompt")
|
| 181 |
submit_btn = gr.Button(value="Submit")
|
| 182 |
with gr.Column():
|
|
|
|
| 58 |
return rescaled_boxes
|
| 59 |
|
| 60 |
|
| 61 |
+
def deepseek(image, text_input):
|
| 62 |
print("helloe!!!!")
|
| 63 |
# specify the path to the model
|
| 64 |
model_path = "deepseek-ai/deepseek-vl2-tiny"
|
|
|
|
| 72 |
conversation = [
|
| 73 |
{
|
| 74 |
"role": "<|User|>",
|
| 75 |
+
"content": f"<image>\n<|ref|>{text_input}<|/ref|>.",
|
| 76 |
"images": ["./images/visual_grounding_1.jpeg"],
|
| 77 |
},
|
| 78 |
{"role": "<|Assistant|>", "content": ""},
|
|
|
|
| 176 |
with gr.Row():
|
| 177 |
with gr.Column():
|
| 178 |
input_img = gr.Image(label="Input Image", type="pil")
|
| 179 |
+
model_selector = gr.Dropdown(choices=list(models.keys()), label="Model", value="deepseek-ai/deepseek-vl2-tiny")
|
| 180 |
text_input = gr.Textbox(label="User Prompt")
|
| 181 |
submit_btn = gr.Button(value="Submit")
|
| 182 |
with gr.Column():
|