Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,10 +19,10 @@ def extract_text_from_pdf(pdf_file):
|
|
19 |
# Function to handle question answering
|
20 |
def answer_question(question, pdf_text):
|
21 |
# Prepare the context for the model
|
22 |
-
inputs = tokenizer(
|
23 |
|
24 |
# Tokenize PDF text
|
25 |
-
pdf_inputs = tokenizer(
|
26 |
|
27 |
# Generate the answer
|
28 |
with torch.no_grad():
|
|
|
19 |
# Function to handle question answering
|
20 |
def answer_question(question, pdf_text):
|
21 |
# Prepare the context for the model
|
22 |
+
inputs = tokenizer(question, return_tensors="pt")
|
23 |
|
24 |
# Tokenize PDF text
|
25 |
+
pdf_inputs = tokenizer(pdf_text, return_tensors="pt")
|
26 |
|
27 |
# Generate the answer
|
28 |
with torch.no_grad():
|