Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -79,7 +79,7 @@ def downsample_video(video_path):
|
|
79 |
vidcap.release()
|
80 |
return frames
|
81 |
|
82 |
-
@spaces.GPU
|
83 |
def generate_image(model_name: str, text: str, image: Image.Image,
|
84 |
max_new_tokens: int = 1024,
|
85 |
temperature: float = 0.6,
|
@@ -98,7 +98,7 @@ def generate_image(model_name: str, text: str, image: Image.Image,
|
|
98 |
elif model_name == "GLM-4.1V-9B-Thinking":
|
99 |
processor = processor_s
|
100 |
model = model_s
|
101 |
-
elif model_name == "ViLaSR":
|
102 |
processor = processor_y
|
103 |
model = model_y
|
104 |
else:
|
@@ -154,7 +154,7 @@ def generate_video(model_name: str, text: str, video_path: str,
|
|
154 |
elif model_name == "GLM-4.1V-9B-Thinking":
|
155 |
processor = processor_s
|
156 |
model = model_s
|
157 |
-
elif model_name == "ViLaSR":
|
158 |
processor = processor_y
|
159 |
model = model_y
|
160 |
else:
|
@@ -271,7 +271,7 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
271 |
markdown_output = gr.Markdown(label="(Result.md)")
|
272 |
|
273 |
model_choice = gr.Radio(
|
274 |
-
choices=["Camel-Doc-OCR-062825", "GLM-4.1V-9B-Thinking", "Megalodon-OCR-Sync-0713", "ViLaSR"],
|
275 |
label="Select Model",
|
276 |
value="Camel-Doc-OCR-062825"
|
277 |
)
|
|
|
79 |
vidcap.release()
|
80 |
return frames
|
81 |
|
82 |
+
@spaces.GPU(duration=120)
|
83 |
def generate_image(model_name: str, text: str, image: Image.Image,
|
84 |
max_new_tokens: int = 1024,
|
85 |
temperature: float = 0.6,
|
|
|
98 |
elif model_name == "GLM-4.1V-9B-Thinking":
|
99 |
processor = processor_s
|
100 |
model = model_s
|
101 |
+
elif model_name == "ViLaSR-7B":
|
102 |
processor = processor_y
|
103 |
model = model_y
|
104 |
else:
|
|
|
154 |
elif model_name == "GLM-4.1V-9B-Thinking":
|
155 |
processor = processor_s
|
156 |
model = model_s
|
157 |
+
elif model_name == "ViLaSR-7B":
|
158 |
processor = processor_y
|
159 |
model = model_y
|
160 |
else:
|
|
|
271 |
markdown_output = gr.Markdown(label="(Result.md)")
|
272 |
|
273 |
model_choice = gr.Radio(
|
274 |
+
choices=["Camel-Doc-OCR-062825", "GLM-4.1V-9B-Thinking", "Megalodon-OCR-Sync-0713", "ViLaSR-7B"],
|
275 |
label="Select Model",
|
276 |
value="Camel-Doc-OCR-062825"
|
277 |
)
|