Spaces:
Running
on
Zero
Running
on
Zero
adaptation to ZeroGPU
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import time
|
2 |
import logging
|
3 |
import gradio as gr
|
@@ -38,7 +39,7 @@ def update_model(model_id, device):
|
|
38 |
model.eval()
|
39 |
model_cache.update({'model_id': model_id, 'processor': processor, 'model': model, 'device': device})
|
40 |
|
41 |
-
|
42 |
def caption_frame(frame, model_id, interval_ms, sys_prompt, usr_prompt, device):
|
43 |
debug_msgs = []
|
44 |
update_model(model_id, device)
|
|
|
1 |
+
import spaces
|
2 |
import time
|
3 |
import logging
|
4 |
import gradio as gr
|
|
|
39 |
model.eval()
|
40 |
model_cache.update({'model_id': model_id, 'processor': processor, 'model': model, 'device': device})
|
41 |
|
42 |
+
@spaces.GPU
|
43 |
def caption_frame(frame, model_id, interval_ms, sys_prompt, usr_prompt, device):
|
44 |
debug_msgs = []
|
45 |
update_model(model_id, device)
|