Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,10 +10,10 @@ 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['
|
14 |
|
15 |
# Convert embeddings to tensor for efficient retrieval
|
16 |
-
embeddings = torch.tensor(df['
|
17 |
|
18 |
# Load the Sentence Transformer model
|
19 |
model = SentenceTransformer('all-MiniLM-L6-v2', device=device)
|
|
|
10 |
|
11 |
# Load the CSV file with embeddings
|
12 |
df = pd.read_csv('RBDx10kstats.csv')
|
13 |
+
df['Abstract'] = df['Abstract'].apply(json.loads) # Convert JSON string back to list
|
14 |
|
15 |
# Convert embeddings to tensor for efficient retrieval
|
16 |
+
embeddings = torch.tensor(df['Abstract'].tolist(), device=device)
|
17 |
|
18 |
# Load the Sentence Transformer model
|
19 |
model = SentenceTransformer('all-MiniLM-L6-v2', device=device)
|