mkoot007 commited on
Commit
196be8d
·
1 Parent(s): be995e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -16,7 +16,10 @@ def extract_text(image):
16
  # Define a function to explain the extracted text
17
  def explain_text(text):
18
  tokenizer = AutoTokenizer.from_pretrained("gpt2")
19
-
 
 
 
20
  # Convert the text to a string if necessary
21
  if not isinstance(text, str):
22
  text = str(text)
 
16
  # Define a function to explain the extracted text
17
  def explain_text(text):
18
  tokenizer = AutoTokenizer.from_pretrained("gpt2")
19
+
20
+ # Set pad_token to eos_token (end of sequence token)
21
+ tokenizer.pad_token = tokenizer.eos_token
22
+
23
  # Convert the text to a string if necessary
24
  if not isinstance(text, str):
25
  text = str(text)