Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import streamlit as st
|
|
3 |
import requests
|
4 |
from PIL import Image
|
5 |
import numpy as np
|
6 |
-
from transformers import
|
7 |
import torch
|
8 |
from huggingface_hub import login
|
9 |
|
@@ -12,9 +12,8 @@ token = os.getenv("HF_Token")
|
|
12 |
login(token)
|
13 |
|
14 |
# Initialize the Hugging Face model
|
15 |
-
|
16 |
-
|
17 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
18 |
|
19 |
# Function to transcribe handwritten notes using Hugging Face model
|
20 |
def transcribe_handwriting(image):
|
|
|
3 |
import requests
|
4 |
from PIL import Image
|
5 |
import numpy as np
|
6 |
+
from transformers import AutoProcessor, AutoModelForPreTraining
|
7 |
import torch
|
8 |
from huggingface_hub import login
|
9 |
|
|
|
12 |
login(token)
|
13 |
|
14 |
# Initialize the Hugging Face model
|
15 |
+
tokenizer = AutoProcessor.from_pretrained("google/paligemma-3b-mix-224")
|
16 |
+
model = AutoModelForPreTraining.from_pretrained("google/paligemma-3b-mix-224")
|
|
|
17 |
|
18 |
# Function to transcribe handwritten notes using Hugging Face model
|
19 |
def transcribe_handwriting(image):
|