fix input bugs
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def inference(raw_image):
|
|
26 |
# raw_image = torch.tensor(raw_image)
|
27 |
image = transform(raw_image).unsqueeze(0).to(device)
|
28 |
with torch.no_grad():
|
29 |
-
caption = model.generate(image, sample=False, num_beams=1, max_length=
|
30 |
return caption[0]
|
31 |
|
32 |
|
|
|
26 |
# raw_image = torch.tensor(raw_image)
|
27 |
image = transform(raw_image).unsqueeze(0).to(device)
|
28 |
with torch.no_grad():
|
29 |
+
caption = model.generate(image, sample=False, num_beams=1, max_length=200, min_length=5)
|
30 |
return caption[0]
|
31 |
|
32 |
|