Eran Fainman
commited on
Commit
Β·
1622188
1
Parent(s):
b51e543
Add application file
Browse files
app.py
CHANGED
@@ -3,9 +3,6 @@ import pandas as pd
|
|
3 |
import streamlit as st
|
4 |
import huggingface_hub as hh
|
5 |
|
6 |
-
st.set_page_config(page_title="RecTour2024 - Booking.com Review Ranking Challenge Leaderboard", layout="wide")
|
7 |
-
st.title("π RecTour2024 Leaderboard")
|
8 |
-
|
9 |
# read files from HF
|
10 |
OWNER = "Booking-com"
|
11 |
REPO_ID = f"{OWNER}/streamlit-review-ranking-leaderboard"
|
@@ -20,12 +17,20 @@ API = hh.HfApi(token=TOKEN)
|
|
20 |
def restart_space():
|
21 |
API.restart_space(repo_id=REPO_ID)
|
22 |
|
|
|
23 |
hh.snapshot_download(
|
24 |
repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type=None, tqdm_class=None, etag_timeout=30,
|
25 |
token=TOKEN
|
26 |
)
|
27 |
|
28 |
-
df_results = pd.read_csv(os.path.join(EVAL_RESULTS_PATH, 'results.csv'))
|
29 |
-
st.table(df_results)
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
|
|
3 |
import streamlit as st
|
4 |
import huggingface_hub as hh
|
5 |
|
|
|
|
|
|
|
6 |
# read files from HF
|
7 |
OWNER = "Booking-com"
|
8 |
REPO_ID = f"{OWNER}/streamlit-review-ranking-leaderboard"
|
|
|
17 |
def restart_space():
|
18 |
API.restart_space(repo_id=REPO_ID)
|
19 |
|
20 |
+
|
21 |
hh.snapshot_download(
|
22 |
repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type=None, tqdm_class=None, etag_timeout=30,
|
23 |
token=TOKEN
|
24 |
)
|
25 |
|
|
|
|
|
26 |
|
27 |
+
def render():
|
28 |
+
st.set_page_config(page_title="RecTour2024 - Booking.com Review Ranking Challenge Leaderboard", layout="wide")
|
29 |
+
st.title("π RecTour2024 Leaderboard")
|
30 |
+
df_results = pd.read_csv(os.path.join(EVAL_RESULTS_PATH, 'results.csv'))
|
31 |
+
st.table(df_results)
|
32 |
+
|
33 |
+
|
34 |
+
if __name__ == "__main__":
|
35 |
+
render()
|
36 |
|