SelmaNajih001 commited on
Commit
54fe267
·
verified ·
1 Parent(s): 214a350

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -13
app.py CHANGED
@@ -48,20 +48,12 @@ embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/multi-qa-mp
48
  import tempfile
49
  tmp_dir = tempfile.mkdtemp()
50
 
51
- # Scarica i file nella cartella temporanea
52
- faiss_index_path = hf_hub_download(
53
- repo_id="SelmaNajih001/DatasetStockFAISS",
54
- filename="index.faiss",
55
- cache_dir=tmp_dir
56
- )
57
- docstore_path = hf_hub_download(
58
- repo_id="SelmaNajih001/DatasetStockFAISS",
59
- filename="index.pkl",
60
- cache_dir=tmp_dir
61
- )
62
 
63
-
64
- vectorstore = FAISS.load_local(tmp_dir, embeddings, allow_dangerous_deserialization=True)
 
 
65
 
66
 
67
  def analisi_finanziaria(query, k=4):
 
48
  import tempfile
49
  tmp_dir = tempfile.mkdtemp()
50
 
51
+ local_faiss_dir = "./faiss_index"
 
 
 
 
 
 
 
 
 
 
52
 
53
+ vectorstore = FAISS.load_local(
54
+ local_faiss_dir,
55
+ embeddings
56
+ )
57
 
58
 
59
  def analisi_finanziaria(query, k=4):