Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,10 +4,10 @@ from sentence_transformers import SentenceTransformer
|
|
| 4 |
import faiss
|
| 5 |
import numpy as np
|
| 6 |
|
| 7 |
-
# Load pre-trained multilingual model for retrieval and generation
|
| 8 |
tokenizer = RagTokenizer.from_pretrained("facebook/rag-token-nq")
|
| 9 |
model = RagSequenceForGeneration.from_pretrained("facebook/rag-token-nq")
|
| 10 |
-
retriever = RagRetriever.from_pretrained("facebook/rag-token-nq", index_name="faiss")
|
| 11 |
|
| 12 |
# Set up FAISS for multilingual document retrieval
|
| 13 |
def setup_faiss():
|
|
|
|
| 4 |
import faiss
|
| 5 |
import numpy as np
|
| 6 |
|
| 7 |
+
# Load pre-trained multilingual model for retrieval and generation with trust_remote_code=True
|
| 8 |
tokenizer = RagTokenizer.from_pretrained("facebook/rag-token-nq")
|
| 9 |
model = RagSequenceForGeneration.from_pretrained("facebook/rag-token-nq")
|
| 10 |
+
retriever = RagRetriever.from_pretrained("facebook/rag-token-nq", index_name="faiss", trust_remote_code=True)
|
| 11 |
|
| 12 |
# Set up FAISS for multilingual document retrieval
|
| 13 |
def setup_faiss():
|