Update app.py
Browse files
app.py
CHANGED
@@ -84,9 +84,10 @@ processortext2 = CustomOCRProcessor(image_processor,tokenizer)
|
|
84 |
app = FastAPI()
|
85 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
86 |
templates = Jinja2Templates(directory="templates")
|
87 |
-
|
|
|
88 |
# Download and load the model
|
89 |
-
model2 = VisionEncoderDecoderModel.from_pretrained("musadac/vilanocr-single-urdu",use_auth_token=
|
90 |
|
91 |
|
92 |
@app.get("/", response_class=HTMLResponse)
|
|
|
84 |
app = FastAPI()
|
85 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
86 |
templates = Jinja2Templates(directory="templates")
|
87 |
+
import os
|
88 |
+
huggingface_token = os.environ.get("HUGGINGFACE_TOKEN")
|
89 |
# Download and load the model
|
90 |
+
model2 = VisionEncoderDecoderModel.from_pretrained("musadac/vilanocr-single-urdu",use_auth_token=huggingface_token).to(device)
|
91 |
|
92 |
|
93 |
@app.get("/", response_class=HTMLResponse)
|