taarhissian commited on
Commit
4fba3ae
·
verified ·
1 Parent(s): b137fa1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -20,7 +20,7 @@ def analyze_image(image, prompt):
20
  inputs = processor(images=image, text=prompt, return_tensors="pt").to(device)
21
 
22
  # Generate output
23
- output = model.generate(**inputs, max_length=50)
24
  result_text = processor.batch_decode(output, skip_special_tokens=True)[0]
25
 
26
  return result_text
 
20
  inputs = processor(images=image, text=prompt, return_tensors="pt").to(device)
21
 
22
  # Generate output
23
+ output = model.generate(**inputs, max_new_tokens=100) # Allow up to 100 new tokens
24
  result_text = processor.batch_decode(output, skip_special_tokens=True)[0]
25
 
26
  return result_text