Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -16,15 +16,11 @@ import easyocr
|
|
16 |
# Initialize FastAPI
|
17 |
app = FastAPI()
|
18 |
|
19 |
-
# Load AI Model for Question Answering on Documents (Mistral-7B)
|
20 |
-
model_name = "TinyLlama/TinyLlama-1.1B-chat"
|
21 |
print(f"π Loading models")
|
22 |
|
23 |
-
doc_qa_pipeline = pipeline("text-generation", model=
|
24 |
-
|
25 |
-
# Load Image Captioning Model (nlpconnect/vit-gpt2-image-captioning)
|
26 |
image_captioning_pipeline = pipeline("image-to-text", model="nlpconnect/vit-gpt2-image-captioning")
|
27 |
-
|
28 |
# Initialize OCR Model (Lazy Load)
|
29 |
reader = easyocr.Reader(["en"], gpu=True)
|
30 |
|
|
|
16 |
# Initialize FastAPI
|
17 |
app = FastAPI()
|
18 |
|
|
|
|
|
19 |
print(f"π Loading models")
|
20 |
|
21 |
+
doc_qa_pipeline = pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-chat")
|
|
|
|
|
22 |
image_captioning_pipeline = pipeline("image-to-text", model="nlpconnect/vit-gpt2-image-captioning")
|
23 |
+
print("models loaded")
|
24 |
# Initialize OCR Model (Lazy Load)
|
25 |
reader = easyocr.Reader(["en"], gpu=True)
|
26 |
|