Spaces:
Sleeping
Sleeping
Shankarm08
commited on
Commit
•
59720f5
1
Parent(s):
2ceb5b6
Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,9 @@ import pandas as pd
|
|
5 |
import pdfplumber
|
6 |
|
7 |
# Load the RAG model and tokenizer
|
8 |
-
tokenizer = RagTokenizer.from_pretrained("facebook/rag-sequence-nq")
|
9 |
-
retriever = RagRetriever.from_pretrained("facebook/wiki_dpr",
|
10 |
-
model = RagSequenceForGeneration.from_pretrained("facebook/rag-sequence-nq", retriever=retriever)
|
11 |
|
12 |
# Function to extract text from a PDF file
|
13 |
def extract_text_from_pdf(pdf_file):
|
|
|
5 |
import pdfplumber
|
6 |
|
7 |
# Load the RAG model and tokenizer
|
8 |
+
tokenizer = RagTokenizer.from_pretrained("facebook/rag-sequence-nq", use_auth_token=True)
|
9 |
+
retriever = RagRetriever.from_pretrained("facebook/wiki_dpr", use_auth_token=True)
|
10 |
+
model = RagSequenceForGeneration.from_pretrained("facebook/rag-sequence-nq", retriever=retriever, use_auth_token=True)
|
11 |
|
12 |
# Function to extract text from a PDF file
|
13 |
def extract_text_from_pdf(pdf_file):
|