Spaces:
Running
on
Zero
Running
on
Zero
update
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from qwen_vl_utils import process_vision_info
|
|
5 |
import re
|
6 |
from PIL import Image, ImageDraw
|
7 |
import numpy as np
|
|
|
8 |
|
9 |
# Initialize model
|
10 |
model_path = 'GD-ML/UniVG-R1'
|
@@ -134,6 +135,7 @@ def update_preview(example_name):
|
|
134 |
gr.Gallery(value=None, visible=False) # Clear result display
|
135 |
)
|
136 |
|
|
|
137 |
def clear_outputs():
|
138 |
"""Clear all outputs"""
|
139 |
return (
|
@@ -144,6 +146,7 @@ def clear_outputs():
|
|
144 |
"" # Clear output text
|
145 |
)
|
146 |
|
|
|
147 |
def process_example(example_name):
|
148 |
"""Process selected example"""
|
149 |
if not example_name:
|
@@ -196,6 +199,7 @@ def process_example(example_name):
|
|
196 |
output_text
|
197 |
)
|
198 |
|
|
|
199 |
def process_custom_input(images, instruction):
|
200 |
"""Process custom user input"""
|
201 |
if not images or not instruction:
|
|
|
5 |
import re
|
6 |
from PIL import Image, ImageDraw
|
7 |
import numpy as np
|
8 |
+
import spaces
|
9 |
|
10 |
# Initialize model
|
11 |
model_path = 'GD-ML/UniVG-R1'
|
|
|
135 |
gr.Gallery(value=None, visible=False) # Clear result display
|
136 |
)
|
137 |
|
138 |
+
@spaces.GPU
|
139 |
def clear_outputs():
|
140 |
"""Clear all outputs"""
|
141 |
return (
|
|
|
146 |
"" # Clear output text
|
147 |
)
|
148 |
|
149 |
+
@spaces.GPU
|
150 |
def process_example(example_name):
|
151 |
"""Process selected example"""
|
152 |
if not example_name:
|
|
|
199 |
output_text
|
200 |
)
|
201 |
|
202 |
+
@spaces.GPU
|
203 |
def process_custom_input(images, instruction):
|
204 |
"""Process custom user input"""
|
205 |
if not images or not instruction:
|