Yoxas commited on
Commit
c30444f
·
verified ·
1 Parent(s): caf5793

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,7 +9,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
9
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
10
 
11
  # Load the CSV file with embeddings
12
- df = pd.read_csv('updated_dataset_with_embeddings.csv')
13
  df['embedding'] = df['embedding'].apply(json.loads) # Convert JSON string back to list
14
 
15
  # Convert embeddings to tensor for efficient retrieval
@@ -19,8 +19,8 @@ embeddings = torch.tensor(df['embedding'].tolist(), device=device)
19
  model = SentenceTransformer('all-MiniLM-L6-v2', device=device)
20
 
21
  # Load the LLaMA model for response generation
22
- llama_tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct")
23
- llama_model = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct").to(device)
24
 
25
  # Define the function to find the most relevant document
26
  def retrieve_relevant_doc(query):
 
9
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
10
 
11
  # Load the CSV file with embeddings
12
+ df = pd.read_csv('RBDx10kstats.csv')
13
  df['embedding'] = df['embedding'].apply(json.loads) # Convert JSON string back to list
14
 
15
  # Convert embeddings to tensor for efficient retrieval
 
19
  model = SentenceTransformer('all-MiniLM-L6-v2', device=device)
20
 
21
  # Load the LLaMA model for response generation
22
+ llama_tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
23
+ llama_model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2").to(device)
24
 
25
  # Define the function to find the most relevant document
26
  def retrieve_relevant_doc(query):