Spaces:
Running
Running
Upload 2 files
Browse files
app.py
CHANGED
|
@@ -305,4 +305,8 @@ if __name__ == "__main__":
|
|
| 305 |
print(f"Popularity Ranking: Enabled")
|
| 306 |
print("Opening at http://127.0.0.1:7860\n")
|
| 307 |
|
| 308 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
print(f"Popularity Ranking: Enabled")
|
| 306 |
print("Opening at http://127.0.0.1:7860\n")
|
| 307 |
|
| 308 |
+
# if run locally
|
| 309 |
+
# app.launch(share=False, server_name="127.0.0.1", server_port=7860, inbrowser=True)
|
| 310 |
+
|
| 311 |
+
# if run on HF Space
|
| 312 |
+
app.launch(ssr_mode=False)
|
main.py
CHANGED
|
@@ -24,6 +24,10 @@ benepar.download('benepar_en3_large')
|
|
| 24 |
# Load dataset
|
| 25 |
data = pd.read_csv("data/toy_data_aggregated_embeddings.csv")
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
# Load precomputed TF-IDF features
|
| 28 |
restaurant_tfidf_features = np.load("data/toy_data_tfidf_features.npz")
|
| 29 |
|
|
|
|
| 24 |
# Load dataset
|
| 25 |
data = pd.read_csv("data/toy_data_aggregated_embeddings.csv")
|
| 26 |
|
| 27 |
+
# Group by source
|
| 28 |
+
restaurant_by_source = {k: v["id"].tolist() for k, v in data.groupby("source")}
|
| 29 |
+
restaurant_by_source
|
| 30 |
+
|
| 31 |
# Load precomputed TF-IDF features
|
| 32 |
restaurant_tfidf_features = np.load("data/toy_data_tfidf_features.npz")
|
| 33 |
|