navidved commited on
Commit
cc9ee1f
·
verified ·
1 Parent(s): e06aafc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -122,7 +122,7 @@ def load_saved_annotations():
122
  repo_id=HF_DATASET_NAME,
123
  filename=annotations_filename_in_repo,
124
  repo_type="dataset",
125
- token=token
126
  )
127
  with open(hf_path, "r", encoding="utf-8") as f:
128
  data = json.load(f)
@@ -168,7 +168,7 @@ def push_json_to_hf():
168
  path_in_repo=annotations_filename_in_repo, # Name of the file in the repository
169
  repo_type="dataset",
170
  repo_id=HF_DATASET_NAME,
171
- token=token,
172
  commit_message=f"Updated {annotations_filename_in_repo} via annotation tool at {datetime.now().isoformat()}"
173
  )
174
  print(f"Push to HF: Successfully uploaded '{annotations_filename_in_repo}' to Hugging Face repository '{HF_DATASET_NAME}'.")
@@ -1235,7 +1235,7 @@ with gr.Blocks(css=css, title="ASR Dataset Labeling Tool") as demo:
1235
  with gr.Column(visible=True, elem_id="login_container") as login_container:
1236
  gr.Markdown("## HF Authentication")
1237
  # hf_token_input default value is also from env var, or empty.
1238
- hf_token_input = gr.Textbox(label="Hugging Face Token", type="password", value=os.getenv("hf_token") or "")
1239
  login_button = gr.Button("Login")
1240
  login_message = gr.Markdown("")
1241
 
 
122
  repo_id=HF_DATASET_NAME,
123
  filename=annotations_filename_in_repo,
124
  repo_type="dataset",
125
+ token=os.getenv("hf_token")
126
  )
127
  with open(hf_path, "r", encoding="utf-8") as f:
128
  data = json.load(f)
 
168
  path_in_repo=annotations_filename_in_repo, # Name of the file in the repository
169
  repo_type="dataset",
170
  repo_id=HF_DATASET_NAME,
171
+ token=os.getenv("hf_token"),
172
  commit_message=f"Updated {annotations_filename_in_repo} via annotation tool at {datetime.now().isoformat()}"
173
  )
174
  print(f"Push to HF: Successfully uploaded '{annotations_filename_in_repo}' to Hugging Face repository '{HF_DATASET_NAME}'.")
 
1235
  with gr.Column(visible=True, elem_id="login_container") as login_container:
1236
  gr.Markdown("## HF Authentication")
1237
  # hf_token_input default value is also from env var, or empty.
1238
+ hf_token_input = gr.Textbox(label="Hugging Face Token", type="password", "")
1239
  login_button = gr.Button("Login")
1240
  login_message = gr.Markdown("")
1241