Spaces:
Runtime error
Runtime error
Odulana Hammed
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import AutoProcessor, AutoModelForImageTextToText
|
| 3 |
from PIL import Image
|
| 4 |
-
|
| 5 |
|
| 6 |
# Load Vision-Instruct model
|
| 7 |
processor = AutoProcessor.from_pretrained("alpindale/Llama-3.2-11B-Vision-Instruct")
|
| 8 |
model = AutoModelForImageTextToText.from_pretrained("alpindale/Llama-3.2-11B-Vision-Instruct")
|
| 9 |
|
|
|
|
| 10 |
def extract_text_from_image(image):
|
| 11 |
"""
|
| 12 |
Function to extract text from a handwritten image using the Meta-Llama model.
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import AutoProcessor, AutoModelForImageTextToText
|
| 3 |
from PIL import Image
|
| 4 |
+
import spaces
|
| 5 |
|
| 6 |
# Load Vision-Instruct model
|
| 7 |
processor = AutoProcessor.from_pretrained("alpindale/Llama-3.2-11B-Vision-Instruct")
|
| 8 |
model = AutoModelForImageTextToText.from_pretrained("alpindale/Llama-3.2-11B-Vision-Instruct")
|
| 9 |
|
| 10 |
+
@spaces.GPU
|
| 11 |
def extract_text_from_image(image):
|
| 12 |
"""
|
| 13 |
Function to extract text from a handwritten image using the Meta-Llama model.
|