Spaces:
Sleeping
Sleeping
Adding spaces.GPU
Browse files
app.py
CHANGED
@@ -126,7 +126,7 @@ def get_docs_from_parquet(parquet_urls, column, offset, limit):
|
|
126 |
return df[column].tolist()
|
127 |
|
128 |
|
129 |
-
|
130 |
def calculate_embeddings(docs):
|
131 |
return sentence_model.encode(docs, show_progress_bar=True, batch_size=32)
|
132 |
|
@@ -137,7 +137,7 @@ def calculate_n_neighbors_and_components(n_rows):
|
|
137 |
return n_neighbors, n_components
|
138 |
|
139 |
|
140 |
-
|
141 |
def fit_model(docs, embeddings, n_neighbors, n_components):
|
142 |
umap_model = UMAP(
|
143 |
n_neighbors=n_neighbors,
|
|
|
126 |
return df[column].tolist()
|
127 |
|
128 |
|
129 |
+
@spaces.GPU
|
130 |
def calculate_embeddings(docs):
|
131 |
return sentence_model.encode(docs, show_progress_bar=True, batch_size=32)
|
132 |
|
|
|
137 |
return n_neighbors, n_components
|
138 |
|
139 |
|
140 |
+
@spaces.GPU
|
141 |
def fit_model(docs, embeddings, n_neighbors, n_components):
|
142 |
umap_model = UMAP(
|
143 |
n_neighbors=n_neighbors,
|