Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import AutoModelForCausalLM, AutoProcessor, GenerationConfig
|
| 4 |
from PIL import Image
|
|
@@ -20,7 +20,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 20 |
device_map='auto'
|
| 21 |
)
|
| 22 |
|
| 23 |
-
|
| 24 |
def describe_image(image, prompt):
|
| 25 |
# Process the image with the user-provided text prompt
|
| 26 |
inputs = processor.process(images=[image], text=prompt)
|
|
|
|
| 1 |
+
#import spaces
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import AutoModelForCausalLM, AutoProcessor, GenerationConfig
|
| 4 |
from PIL import Image
|
|
|
|
| 20 |
device_map='auto'
|
| 21 |
)
|
| 22 |
|
| 23 |
+
#@spaces.GPU
|
| 24 |
def describe_image(image, prompt):
|
| 25 |
# Process the image with the user-provided text prompt
|
| 26 |
inputs = processor.process(images=[image], text=prompt)
|