bravewiki commited on
Commit
34d51d0
·
verified ·
1 Parent(s): 60c15f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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 AutoTokenizer, AutoModelForCausalLM
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
- model_name = "google/paligemma-3b-mix-224"
16
- tokenizer = AutoTokenizer.from_pretrained(model_name)
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):