Swekerr commited on
Commit
f782070
1 Parent(s): c0f81ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -46,7 +46,7 @@ def ocr_and_search(image, keyword):
46
 
47
  # Generate text
48
  with torch.no_grad():
49
- generated_ids = model.generate(**inputs, max_new_tokens=50)
50
  generated_ids_trimmed = [out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)]
51
  extracted_text = processor.batch_decode(
52
  generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
 
46
 
47
  # Generate text
48
  with torch.no_grad():
49
+ generated_ids = model.generate(**inputs, max_new_tokens=2000)
50
  generated_ids_trimmed = [out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)]
51
  extracted_text = processor.batch_decode(
52
  generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False