mery22 commited on
Commit
663e8a7
1 Parent(s): 7633195

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -9
app.py CHANGED
@@ -33,15 +33,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
33
  tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
34
  model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
35
 
36
- dataset= load_dataset("test-1.pdf")
37
- loader = PyPDFLoader(dataset)
38
- data = loader.load()
39
- text_splitter1 = CharacterTextSplitter(chunk_size=512, chunk_overlap=0,separator="\n\n")
40
- texts = text_splitter1.split_documents(data)
41
- db = FAISS.from_documents(texts,
42
- HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L12-v2'))
43
-
44
-
45
  # Connect query to FAISS index using a retriever
46
  retriever = db.as_retriever(
47
  search_type="mmr",
 
33
  tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
34
  model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
35
 
36
+ load_dataset("pandas", data_files="index.pkl")
 
 
 
 
 
 
 
 
37
  # Connect query to FAISS index using a retriever
38
  retriever = db.as_retriever(
39
  search_type="mmr",