m7mdal7aj commited on
Commit
fcca3a5
1 Parent(s): 8e2f248

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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=200, min_length=20)
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