rehan953 commited on
Commit
44afe78
·
verified ·
1 Parent(s): 34664c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -123,8 +123,12 @@ def _infer_image(image_path: str) -> str:
123
  torch.cuda.empty_cache()
124
 
125
  with torch.no_grad():
126
- ids = model.generate(**inputs, max_new_tokens=MAX_NEW_TOKENS)
127
-
 
 
 
 
128
  result = processor.decode(
129
  ids[0][inputs["input_ids"].shape[1]:],
130
  skip_special_tokens=True,
 
123
  torch.cuda.empty_cache()
124
 
125
  with torch.no_grad():
126
+ ids = model.generate(
127
+ **inputs,
128
+ max_new_tokens=MAX_NEW_TOKENS,
129
+ do_sample=False,
130
+ repetition_penalty=1.1,
131
+ )
132
  result = processor.decode(
133
  ids[0][inputs["input_ids"].shape[1]:],
134
  skip_special_tokens=True,