Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import argparse
|
2 |
import json
|
3 |
import os
|
@@ -7,7 +8,7 @@ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENT
|
|
7 |
import sys
|
8 |
import threading
|
9 |
|
10 |
-
|
11 |
|
12 |
|
13 |
# Add pre-build setup for Hugging Face Spaces
|
@@ -206,7 +207,7 @@ def process_image_with_streaming(
|
|
206 |
return gdino_vis_result, ref_vis_result, output_text
|
207 |
|
208 |
|
209 |
-
|
210 |
def process_image_non_streaming(
|
211 |
image,
|
212 |
system_prompt,
|
@@ -233,7 +234,7 @@ def process_image_non_streaming(
|
|
233 |
)
|
234 |
|
235 |
|
236 |
-
|
237 |
def create_streaming_interface(models):
|
238 |
"""Create a streaming interface using a different approach"""
|
239 |
(
|
@@ -242,6 +243,7 @@ def create_streaming_interface(models):
|
|
242 |
rexthinker_model,
|
243 |
) = models
|
244 |
|
|
|
245 |
def process_with_streaming(
|
246 |
image,
|
247 |
system_prompt,
|
|
|
1 |
+
import spaces
|
2 |
import argparse
|
3 |
import json
|
4 |
import os
|
|
|
8 |
import sys
|
9 |
import threading
|
10 |
|
11 |
+
|
12 |
|
13 |
|
14 |
# Add pre-build setup for Hugging Face Spaces
|
|
|
207 |
return gdino_vis_result, ref_vis_result, output_text
|
208 |
|
209 |
|
210 |
+
|
211 |
def process_image_non_streaming(
|
212 |
image,
|
213 |
system_prompt,
|
|
|
234 |
)
|
235 |
|
236 |
|
237 |
+
|
238 |
def create_streaming_interface(models):
|
239 |
"""Create a streaming interface using a different approach"""
|
240 |
(
|
|
|
243 |
rexthinker_model,
|
244 |
) = models
|
245 |
|
246 |
+
@spaces.GPU
|
247 |
def process_with_streaming(
|
248 |
image,
|
249 |
system_prompt,
|