Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,16 @@ from torchvision.transforms import functional as F
|
|
6 |
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
|
7 |
from transformers import AutoModel
|
8 |
|
|
|
|
|
|
|
9 |
access_token = os.environ.get("HF_TOKEN")
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
model = AutoModel.from_pretrained("trocrnew.pth", token=access_token)
|
12 |
app = Flask(__name__)
|
13 |
|
14 |
# Load the trained model and processor
|
|
|
6 |
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
|
7 |
from transformers import AutoModel
|
8 |
|
9 |
+
from transformers import AutoModel
|
10 |
+
|
11 |
+
model_name = "trocrnew.pth"
|
12 |
access_token = os.environ.get("HF_TOKEN")
|
13 |
+
model = AutoModel.from_pretrained(model_name, token=access_token)
|
14 |
+
|
15 |
+
# access_token = os.environ.get("HF_TOKEN")
|
16 |
+
|
17 |
+
# model = AutoModel.from_pretrained("trocrnew.pth", token=access_token)
|
18 |
|
|
|
19 |
app = Flask(__name__)
|
20 |
|
21 |
# Load the trained model and processor
|