Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,8 @@ import open_clip
|
|
| 4 |
import gradio as gr
|
| 5 |
from mobileclip.modules.common.mobileone import reparameterize_model
|
| 6 |
|
|
|
|
|
|
|
| 7 |
################################################################################
|
| 8 |
# Model Configuration
|
| 9 |
################################################################################
|
|
@@ -51,6 +53,7 @@ def load_model(model_name):
|
|
| 51 |
################################################################################
|
| 52 |
# Inference
|
| 53 |
################################################################################
|
|
|
|
| 54 |
def classify_image(image, candidate_labels, model_name):
|
| 55 |
"""
|
| 56 |
Classify image using selected MobileCLIP2 model
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
from mobileclip.modules.common.mobileone import reparameterize_model
|
| 6 |
|
| 7 |
+
import spaces
|
| 8 |
+
|
| 9 |
################################################################################
|
| 10 |
# Model Configuration
|
| 11 |
################################################################################
|
|
|
|
| 53 |
################################################################################
|
| 54 |
# Inference
|
| 55 |
################################################################################
|
| 56 |
+
@spaces.GPU(duration=120)
|
| 57 |
def classify_image(image, candidate_labels, model_name):
|
| 58 |
"""
|
| 59 |
Classify image using selected MobileCLIP2 model
|