Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import torch
|
|
|
2 |
import gradio as gr
|
3 |
from transformers import AutoModelForCausalLM, AutoProcessor
|
4 |
from PIL import ImageDraw
|
@@ -46,6 +47,7 @@ def florence_output_to_box(output):
|
|
46 |
return None
|
47 |
|
48 |
|
|
|
49 |
def run_example(image, text_input, model_id="AskUI/PTA-1"):
|
50 |
model = models[model_id].to(device, torch_dtype)
|
51 |
processor = processors[model_id]
|
|
|
1 |
import torch
|
2 |
+
import spaces
|
3 |
import gradio as gr
|
4 |
from transformers import AutoModelForCausalLM, AutoProcessor
|
5 |
from PIL import ImageDraw
|
|
|
47 |
return None
|
48 |
|
49 |
|
50 |
+
@spaces.GPU
|
51 |
def run_example(image, text_input, model_id="AskUI/PTA-1"):
|
52 |
model = models[model_id].to(device, torch_dtype)
|
53 |
processor = processors[model_id]
|