Update app.py
Browse files
app.py
CHANGED
@@ -46,9 +46,17 @@ for i, doc in enumerate(split_docs[:5]):
|
|
46 |
# ===================
|
47 |
# Embeddings árabes
|
48 |
# ===================
|
49 |
-
model_name = "
|
50 |
embeddings = HuggingFaceEmbeddings(model_name=model_name)
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
# Crear vectorstore
|
53 |
batch_size = 100
|
54 |
vectorstore = None
|
|
|
46 |
# ===================
|
47 |
# Embeddings árabes
|
48 |
# ===================
|
49 |
+
model_name = "CAMeL-Lab/bert-base-arabic-camelbert-mnli"
|
50 |
embeddings = HuggingFaceEmbeddings(model_name=model_name)
|
51 |
|
52 |
+
# Generar índice FAISS con los embeddings
|
53 |
+
db = FAISS.from_documents(texts, embeddings)
|
54 |
+
|
55 |
+
# Guardar el índice si quieres (opcional pero útil para no repetir este proceso)
|
56 |
+
db.save_local("faiss_index")
|
57 |
+
|
58 |
+
db = FAISS.load_local("faiss_index", embeddings)
|
59 |
+
|
60 |
# Crear vectorstore
|
61 |
batch_size = 100
|
62 |
vectorstore = None
|