Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import torch
|
| 3 |
from PIL import Image
|
| 4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 5 |
-
import spaces
|
| 6 |
|
| 7 |
# Model configuration
|
| 8 |
MID = "apple/FastVLM-0.5B"
|
|
@@ -35,7 +35,7 @@ def load_model():
|
|
| 35 |
print(f"Model loaded on {device.upper()} successfully!")
|
| 36 |
return tok, model
|
| 37 |
|
| 38 |
-
|
| 39 |
def caption_image(image, custom_prompt=None):
|
| 40 |
if image is None:
|
| 41 |
return "Please upload an image first."
|
|
|
|
| 2 |
import torch
|
| 3 |
from PIL import Image
|
| 4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 5 |
+
#import spaces
|
| 6 |
|
| 7 |
# Model configuration
|
| 8 |
MID = "apple/FastVLM-0.5B"
|
|
|
|
| 35 |
print(f"Model loaded on {device.upper()} successfully!")
|
| 36 |
return tok, model
|
| 37 |
|
| 38 |
+
#@spaces.GPU(duration=60)
|
| 39 |
def caption_image(image, custom_prompt=None):
|
| 40 |
if image is None:
|
| 41 |
return "Please upload an image first."
|