vinmay1234 commited on
Commit
d5496a8
1 Parent(s): 94ffe87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -1,5 +1,5 @@
1
 
2
- !pip install datasets transformers accelerate peft bitsandbytes
3
  from datasets import load_dataset
4
 
5
  # Load 70% of the Wikipedia dataset
@@ -89,9 +89,7 @@ def prepare_labels(batch):
89
  # Apply the transformation to add labels
90
  tokenized_dataset = tokenized_dataset.map(prepare_labels, batched=True)
91
  # Step 1: Install FAISS for the Vector Database
92
- !pip install faiss-cpu
93
- !pip install faiss-gpu
94
- !pip install sentence_transformersimport torch
95
  from datasets import Dataset
96
  from transformers import AutoModel, AutoTokenizer
97
  import faiss
@@ -232,8 +230,7 @@ def rag_pipeline(question, faiss_index, dataset, top_k=3):
232
  answer = generate_answer(question, retrieved_texts)
233
 
234
  return answer
235
- !pip install ollama
236
- !ollama pull llama2
237
  # Import the necessary modules
238
  from langchain_community.llms import Ollama
239
 
 
1
 
2
+
3
  from datasets import load_dataset
4
 
5
  # Load 70% of the Wikipedia dataset
 
89
  # Apply the transformation to add labels
90
  tokenized_dataset = tokenized_dataset.map(prepare_labels, batched=True)
91
  # Step 1: Install FAISS for the Vector Database
92
+
 
 
93
  from datasets import Dataset
94
  from transformers import AutoModel, AutoTokenizer
95
  import faiss
 
230
  answer = generate_answer(question, retrieved_texts)
231
 
232
  return answer
233
+
 
234
  # Import the necessary modules
235
  from langchain_community.llms import Ollama
236