Update app.py
Browse files
app.py
CHANGED
@@ -38,10 +38,10 @@ def answer_question(image, question, model, processor):
|
|
38 |
|
39 |
if isinstance(model, torch.nn.DataParallel):
|
40 |
# Use the 'module' attribute to access the original model
|
41 |
-
out = model.module.generate(**inputs)
|
42 |
else:
|
43 |
|
44 |
-
out = model.generate(**inputs, max_length=
|
45 |
|
46 |
answer = processor.decode(out[0], skip_special_tokens=True).strip()
|
47 |
return answer
|
|
|
38 |
|
39 |
if isinstance(model, torch.nn.DataParallel):
|
40 |
# Use the 'module' attribute to access the original model
|
41 |
+
out = model.module.generate(**inputs, max_length=100, min_length=20)
|
42 |
else:
|
43 |
|
44 |
+
out = model.generate(**inputs, max_length=100, min_length=20)
|
45 |
|
46 |
answer = processor.decode(out[0], skip_special_tokens=True).strip()
|
47 |
return answer
|