lyx97 commited on
Commit
5c1d888
·
1 Parent(s): 23893c5
Files changed (1) hide show
  1. app.py +18 -12
app.py CHANGED
@@ -15,11 +15,11 @@ global data_component, filter_component
15
  from huggingface_hub import Repository, HfApi
16
  hf_token = os.getenv('HF_TOKEN')
17
  api = HfApi(token=hf_token)
18
- repo = Repository(
19
- local_dir=".",
20
- clone_from="https://huggingface.co/spaces/lyx97/TempCompass",
21
- use_auth_token=hf_token,
22
- )
23
 
24
  def validate_model_size(s):
25
  pattern = r'^\d+B$|^-$'
@@ -113,13 +113,19 @@ def add_new_eval(
113
  csv_data.to_csv(CSV_DIR, index=False)
114
 
115
  # push newly added result
116
- print(repo.git_remote_url())
117
- print("git add...")
118
- repo.git_add(CSV_DIR)
119
- print("git commit...")
120
- repo.git_commit(f"add {model_name_textbox}")
121
- print("git push...")
122
- repo.push_to_hub()
 
 
 
 
 
 
123
  return 0
124
 
125
  def get_baseline_df():
 
15
  from huggingface_hub import Repository, HfApi
16
  hf_token = os.getenv('HF_TOKEN')
17
  api = HfApi(token=hf_token)
18
+ # repo = Repository(
19
+ # local_dir=".",
20
+ # clone_from="https://huggingface.co/spaces/lyx97/TempCompass",
21
+ # use_auth_token=hf_token,
22
+ # )
23
 
24
  def validate_model_size(s):
25
  pattern = r'^\d+B$|^-$'
 
113
  csv_data.to_csv(CSV_DIR, index=False)
114
 
115
  # push newly added result
116
+ # print(repo.git_remote_url())
117
+ # print("git add...")
118
+ # repo.git_add(CSV_DIR)
119
+ # print("git commit...")
120
+ # repo.git_commit(f"add {model_name_textbox}")
121
+ # print("git push...")
122
+ # repo.push_to_hub()
123
+ api.upload_file(
124
+ path_or_fileobj=CSV_DIR,
125
+ path_in_repo=CSV_DIR,
126
+ repo_id="https://huggingface.co/spaces/lyx97/TempCompass",
127
+ repo_type="spaces",
128
+ )
129
  return 0
130
 
131
  def get_baseline_df():