Moha782 commited on
Commit
b2d6cd4
·
verified ·
1 Parent(s): 8f3a10f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
  from pathlib import Path
3
- from transformers import RAGTokenForingModel, AutoTokenizer, AutoModelForCausalLM
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 = RAGTokenForingModel.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")
 
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")