Spaces:
Running
Running
Commit
·
b9cbc26
1
Parent(s):
cb5f0c4
Add Python and Torch version logging to app startup
Browse files
app.py
CHANGED
@@ -3,9 +3,14 @@ from PIL import Image
|
|
3 |
from transformers import AutoTokenizer, AutoProcessor, AutoModelForImageTextToText
|
4 |
import torch
|
5 |
import spaces
|
|
|
6 |
|
7 |
model_path = "nanonets/Nanonets-OCR-s"
|
8 |
|
|
|
|
|
|
|
|
|
9 |
# Load model once at startup
|
10 |
print("Loading Nanonets OCR model...")
|
11 |
model = AutoModelForImageTextToText.from_pretrained(
|
|
|
3 |
from transformers import AutoTokenizer, AutoProcessor, AutoModelForImageTextToText
|
4 |
import torch
|
5 |
import spaces
|
6 |
+
import sys
|
7 |
|
8 |
model_path = "nanonets/Nanonets-OCR-s"
|
9 |
|
10 |
+
# Print python version, torch and cuda version
|
11 |
+
print(f"Torch version: {torch.__version__}")
|
12 |
+
print(f"Python version: {sys.version}")
|
13 |
+
|
14 |
# Load model once at startup
|
15 |
print("Loading Nanonets OCR model...")
|
16 |
model = AutoModelForImageTextToText.from_pretrained(
|