Spaces:
Build error
Build error
Ahsen Khaliq
commited on
Commit
•
c6a9352
1
Parent(s):
8e91121
Update app.py
Browse files
app.py
CHANGED
@@ -48,8 +48,8 @@ model_vq = model_vq.to(device)
|
|
48 |
|
49 |
|
50 |
|
51 |
-
def inference(raw_image,
|
52 |
-
if
|
53 |
image = transform(raw_image).unsqueeze(0).to(device)
|
54 |
with torch.no_grad():
|
55 |
caption = model.generate(image, sample=False, num_beams=3, max_length=20, min_length=5)
|
|
|
48 |
|
49 |
|
50 |
|
51 |
+
def inference(raw_image, model_n, question):
|
52 |
+
if model_n == 'Image Captioning':
|
53 |
image = transform(raw_image).unsqueeze(0).to(device)
|
54 |
with torch.no_grad():
|
55 |
caption = model.generate(image, sample=False, num_beams=3, max_length=20, min_length=5)
|