musadac commited on
Commit
997c58a
1 Parent(s): 05fb821

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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=True).to(device)
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)