JarvisKi commited on
Commit
93ea772
·
verified ·
1 Parent(s): bc0cc2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -2,14 +2,13 @@ import json
2
  import gradio as gr
3
  from huggingface_hub import CommitScheduler
4
  from pathlib import Path
 
5
 
6
- # 已有数据的路径
7
- data_file_path = 'leaderboard_data.json'
8
-
9
- # 加载已有的数据
10
  def load_data():
11
- with open(data_file_path, 'r') as file:
12
- return json.load(file)
 
 
13
 
14
  existing_data = load_data()
15
 
 
2
  import gradio as gr
3
  from huggingface_hub import CommitScheduler
4
  from pathlib import Path
5
+ import requests
6
 
 
 
 
 
7
  def load_data():
8
+ url = "https://huggingface.co/datasets/stabletoolbench/StableToolBench_data/resolve/main/data/leaderboard_data.json"
9
+ response = requests.get(url)
10
+ data = response.json() # 将下载的内容解析为 JSON
11
+ return data
12
 
13
  existing_data = load_data()
14