Spaces:
Build error
Build error
Update caption.py
Browse files- caption.py +3 -2
caption.py
CHANGED
|
@@ -15,8 +15,9 @@ use_fp16 = device.type == "cuda"
|
|
| 15 |
if use_fp16:
|
| 16 |
model.half()
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
# Prediction function
|
|
|
|
| 15 |
if use_fp16:
|
| 16 |
model.half()
|
| 17 |
|
| 18 |
+
max_length = 16
|
| 19 |
+
num_beams = 4
|
| 20 |
+
gen_kwargs = {'max_length': max_length, 'num_beams': num_beams}
|
| 21 |
|
| 22 |
|
| 23 |
# Prediction function
|