Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1073,7 +1073,6 @@ def get_datasets_data(progress=gr.Progress()):
|
|
1073 |
|
1074 |
|
1075 |
|
1076 |
-
# ๋จผ์ target_datasets ์ ์๋ฅผ ์ฝ๋ ์๋จ์ผ๋ก ์ด๋
|
1077 |
target_datasets = {
|
1078 |
"aiqtech/kolaw": "https://huggingface.co/datasets/aiqtech/kolaw",
|
1079 |
"heegyu/korquad-v1-v2": "https://huggingface.co/datasets/heegyu/korquad-v1-v2",
|
@@ -1089,9 +1088,9 @@ target_datasets = {
|
|
1089 |
"upstage/open-ko-llm-leaderboard": "https://huggingface.co/datasets/upstage/open-ko-llm-leaderboard"
|
1090 |
}
|
1091 |
|
1092 |
-
|
1093 |
def get_datasets_data(progress=gr.Progress()):
|
1094 |
-
|
|
|
1095 |
def calculate_rank(dataset_id, all_global_datasets, korea_datasets):
|
1096 |
# ๊ธ๋ก๋ฒ ์์ ํ์ธ
|
1097 |
global_rank = next((idx for idx, d in enumerate(all_global_datasets, 1)
|
@@ -1283,8 +1282,8 @@ def get_datasets_data(progress=gr.Progress()):
|
|
1283 |
} for d in filtered_datasets])
|
1284 |
|
1285 |
progress(1.0, desc="Complete!")
|
|
|
1286 |
return fig, html_content, df
|
1287 |
-
|
1288 |
except Exception as e:
|
1289 |
print(f"Error in get_datasets_data: {str(e)}")
|
1290 |
error_fig = create_error_plot()
|
@@ -1297,8 +1296,7 @@ def get_datasets_data(progress=gr.Progress()):
|
|
1297 |
empty_df = pd.DataFrame(columns=['Global Rank', 'Dataset ID', 'Title', 'Downloads', 'Likes', 'Korea Search', 'URL'])
|
1298 |
return error_fig, error_html, empty_df
|
1299 |
|
1300 |
-
|
1301 |
-
# Gradio UI ๋ถ๋ถ
|
1302 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
1303 |
gr.Markdown("""
|
1304 |
# ๐ค ํ๊น
ํ์ด์ค 'ํ๊ตญ(์ธ์ด) ๋ฆฌ๋๋ณด๋'
|
@@ -1340,6 +1338,16 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
1340 |
datasets_plot, datasets_info, datasets_df
|
1341 |
]
|
1342 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1343 |
|
1344 |
# Gradio ์ฑ ์คํ
|
1345 |
demo.launch(
|
|
|
1073 |
|
1074 |
|
1075 |
|
|
|
1076 |
target_datasets = {
|
1077 |
"aiqtech/kolaw": "https://huggingface.co/datasets/aiqtech/kolaw",
|
1078 |
"heegyu/korquad-v1-v2": "https://huggingface.co/datasets/heegyu/korquad-v1-v2",
|
|
|
1088 |
"upstage/open-ko-llm-leaderboard": "https://huggingface.co/datasets/upstage/open-ko-llm-leaderboard"
|
1089 |
}
|
1090 |
|
|
|
1091 |
def get_datasets_data(progress=gr.Progress()):
|
1092 |
+
try:
|
1093 |
+
|
1094 |
def calculate_rank(dataset_id, all_global_datasets, korea_datasets):
|
1095 |
# ๊ธ๋ก๋ฒ ์์ ํ์ธ
|
1096 |
global_rank = next((idx for idx, d in enumerate(all_global_datasets, 1)
|
|
|
1282 |
} for d in filtered_datasets])
|
1283 |
|
1284 |
progress(1.0, desc="Complete!")
|
1285 |
+
|
1286 |
return fig, html_content, df
|
|
|
1287 |
except Exception as e:
|
1288 |
print(f"Error in get_datasets_data: {str(e)}")
|
1289 |
error_fig = create_error_plot()
|
|
|
1296 |
empty_df = pd.DataFrame(columns=['Global Rank', 'Dataset ID', 'Title', 'Downloads', 'Likes', 'Korea Search', 'URL'])
|
1297 |
return error_fig, error_html, empty_df
|
1298 |
|
1299 |
+
|
|
|
1300 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
1301 |
gr.Markdown("""
|
1302 |
# ๐ค ํ๊น
ํ์ด์ค 'ํ๊ตญ(์ธ์ด) ๋ฆฌ๋๋ณด๋'
|
|
|
1338 |
datasets_plot, datasets_info, datasets_df
|
1339 |
]
|
1340 |
)
|
1341 |
+
|
1342 |
+
# ์ด๊ธฐ ๋ฐ์ดํฐ ๋ก๋
|
1343 |
+
spaces_results = get_spaces_data("trending")
|
1344 |
+
models_results = get_models_data()
|
1345 |
+
datasets_results = get_datasets_data()
|
1346 |
+
|
1347 |
+
trending_plot.value, trending_info.value, trending_df.value = spaces_results
|
1348 |
+
models_plot.value, models_
|
1349 |
+
|
1350 |
+
|
1351 |
|
1352 |
# Gradio ์ฑ ์คํ
|
1353 |
demo.launch(
|