Spaces:
Running
Running
Update app.py
Browse files
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 |
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
|