Mohamed Rashad commited on
Commit
a1f7c90
·
1 Parent(s): 964288a

feat: Add repetition penalty to text extraction functions for improved output quality

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -54,6 +54,7 @@ def extract_text_from_image(image, model_name):
54
  "pixel_values": pixel_values,
55
  "min_length": 1,
56
  "max_new_tokens": context_length,
 
57
  "streamer": streamer,
58
  }
59
 
@@ -94,6 +95,7 @@ def extract_text_from_pdf(pdf_path, model_name):
94
  "pixel_values": pixel_values,
95
  "min_length": 1,
96
  "max_new_tokens": context_length,
 
97
  "streamer": streamer,
98
  }
99
 
 
54
  "pixel_values": pixel_values,
55
  "min_length": 1,
56
  "max_new_tokens": context_length,
57
+ "repetition_penalty": 1.5,
58
  "streamer": streamer,
59
  }
60
 
 
95
  "pixel_values": pixel_values,
96
  "min_length": 1,
97
  "max_new_tokens": context_length,
98
+ "repetition_penalty": 1.5,
99
  "streamer": streamer,
100
  }
101