Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
4bf21ae
1
Parent(s):
54c9e50
Fixed lazy loading caption_generator
Browse files
main.py
CHANGED
|
@@ -11,7 +11,11 @@ def startup_event():
|
|
| 11 |
global caption_generator
|
| 12 |
if caption_generator is None:
|
| 13 |
print("Loading CaptionGenerator...")
|
| 14 |
-
caption_generator = CaptionGenerator(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
@app.get("/", response_class=HTMLResponse)
|
| 17 |
def root():
|
|
|
|
| 11 |
global caption_generator
|
| 12 |
if caption_generator is None:
|
| 13 |
print("Loading CaptionGenerator...")
|
| 14 |
+
caption_generator = CaptionGenerator(
|
| 15 |
+
model_type="CLIPEncoder",
|
| 16 |
+
checkpoint_path="./vit_captioning/artifacts/CLIPEncoder_40epochs_unfreeze12.pth",
|
| 17 |
+
quantized=False
|
| 18 |
+
)
|
| 19 |
|
| 20 |
@app.get("/", response_class=HTMLResponse)
|
| 21 |
def root():
|