Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from sentence_transformers import SentenceTransformer, util
|
| 3 |
-
import
|
| 4 |
|
| 5 |
-
# Load your data
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
|
| 8 |
|
| 9 |
# Precompute embeddings
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from sentence_transformers import SentenceTransformer, util
|
| 3 |
+
import pandas as pd
|
| 4 |
|
| 5 |
+
# Load your data from the CSV file
|
| 6 |
+
data_file = "train_1.csv" # Replace with your CSV file name
|
| 7 |
+
df = pd.read_csv(data_file)
|
| 8 |
+
|
| 9 |
+
# Assuming your CSV has a column named 'text' with the data
|
| 10 |
+
data = df['text'].tolist()
|
| 11 |
+
|
| 12 |
+
# Load the SentenceTransformer model
|
| 13 |
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
|
| 14 |
|
| 15 |
# Precompute embeddings
|