Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from pathlib import Path
|
3 |
-
from transformers import
|
4 |
from pdfplumber import open as open_pdf
|
5 |
from typing import List
|
6 |
|
@@ -15,7 +15,7 @@ text_chunks: List[str] = [text[i:i+chunk_size] for i in range(0, len(text), chun
|
|
15 |
|
16 |
# Load the RAG model and tokenizer for retrieval
|
17 |
rag_tokenizer = AutoTokenizer.from_pretrained("facebook/rag-token-nq")
|
18 |
-
rag_model =
|
19 |
|
20 |
# Load the DialoGPT model and tokenizer for generation
|
21 |
dialogpt_tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-medium")
|
|
|
1 |
import gradio as gr
|
2 |
from pathlib import Path
|
3 |
+
from transformers import RagTokenForGeneration, AutoTokenizer, AutoModelForCausalLM
|
4 |
from pdfplumber import open as open_pdf
|
5 |
from typing import List
|
6 |
|
|
|
15 |
|
16 |
# Load the RAG model and tokenizer for retrieval
|
17 |
rag_tokenizer = AutoTokenizer.from_pretrained("facebook/rag-token-nq")
|
18 |
+
rag_model = RagTokenForGeneration.from_pretrained("facebook/rag-token-nq")
|
19 |
|
20 |
# Load the DialoGPT model and tokenizer for generation
|
21 |
dialogpt_tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-medium")
|