Namitg02 commited on
Commit
78f9bd7
·
verified ·
1 Parent(s): ca9de4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -16,8 +16,9 @@ from transformers import TextIteratorStreamer
16
  from threading import Thread
17
 
18
 
19
- dataset = load_dataset("Namitg02/Test", split='train', streaming=False)
20
- print(dataset)
 
21
  # Returns a list of dictionaries, each representing a row in the dataset.
22
  print(dataset[1])
23
  #splitter = RecursiveCharacterTextSplitter(chunk_size=150, chunk_overlap=25,separators=["\n\n"]) # ["\n\n", "\n", " ", ""])
@@ -35,14 +36,16 @@ embedding_model = HuggingFaceEmbeddings(model_name = "all-MiniLM-L6-v2")
35
 
36
  # Returns a FAISS wrapper vector store. Input is a list of strings. from_documents method used documents to Return VectorStore
37
 
38
- data = dataset["text"]
 
 
39
  print(data)
40
  data = data.add_faiss_index("embeddings")
41
  # adds a column that has a index of embeddings
42
 
43
 
44
  print("check1")
45
- question = "How can I reverse Diabetes?"
46
 
47
  SYS_PROMPT = """You are an assistant for answering questions.
48
  You are given the extracted parts of a long document and a question. Provide a conversational answer.
 
16
  from threading import Thread
17
 
18
 
19
+ #dataset = load_dataset("Namitg02/Test", split='train', streaming=False)
20
+ dataset = load_dataset("not-lain/wikipedia",revision = "embedded")
21
+
22
  # Returns a list of dictionaries, each representing a row in the dataset.
23
  print(dataset[1])
24
  #splitter = RecursiveCharacterTextSplitter(chunk_size=150, chunk_overlap=25,separators=["\n\n"]) # ["\n\n", "\n", " ", ""])
 
36
 
37
  # Returns a FAISS wrapper vector store. Input is a list of strings. from_documents method used documents to Return VectorStore
38
 
39
+ #data = dataset["text"]
40
+ data = dataset["train"]
41
+
42
  print(data)
43
  data = data.add_faiss_index("embeddings")
44
  # adds a column that has a index of embeddings
45
 
46
 
47
  print("check1")
48
+ #question = "How can I reverse Diabetes?"
49
 
50
  SYS_PROMPT = """You are an assistant for answering questions.
51
  You are given the extracted parts of a long document and a question. Provide a conversational answer.