davanstrien HF staff commited on
Commit
d4e77f2
·
1 Parent(s): 3701087

make scheduler 30 mins for testing

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -134,7 +134,7 @@ def parse_hub_id_entry(hub_id: str) -> Union[str, List[str]]:
134
  except HFValidationError as e:
135
  raise gr.Error(f"Invalid format for Hugging Face Hub dataset ID. {e}") from e
136
  except RepositoryNotFoundError as e:
137
- raise gr.Error("Invalid Hugging Face Hub dataset ID") from e
138
 
139
 
140
  def remove_user_from_tracking_datasets(dataset_id, profile: gr.OAuthProfile | None):
@@ -399,8 +399,10 @@ This Gradio app allows you to track datasets hosted on the Hugging Face Hub and
399
 
400
  **Tip** *You can use a wildcard `*` to track all datasets for a user or organization on the hub. For example `biglam/*` will create alerts for all the datasets under the biglam Hugging Face Organization*
401
 
 
402
 
403
- **You need to be logged in to your Hugging Face account to use this app.** If you don't have a Hugging Face Hub account you can get one <a href="https://huggingface.co/join">here</a>.
 
404
  """
405
 
406
  with gr.Blocks() as demo:
@@ -439,13 +441,13 @@ with gr.Blocks() as demo:
439
  user_stats_btn.click(user_stats, [], output)
440
  scheduler = BackgroundScheduler()
441
 
442
- if local:
443
- scheduler.add_job(notify_about_new_models, "interval", minutes=30)
444
- else:
445
- scheduler.add_job(
446
- notify_about_new_models,
447
- CronTrigger.from_crontab("0 */12 * * *"),
448
- )
449
  scheduler.start()
450
  demo.queue(max_size=5)
451
  demo.launch()
 
134
  except HFValidationError as e:
135
  raise gr.Error(f"Invalid format for Hugging Face Hub dataset ID. {e}") from e
136
  except RepositoryNotFoundError as e:
137
+ raise gr.Error(f"{hub_id}: Invalid Hugging Face Hub dataset ID") from e
138
 
139
 
140
  def remove_user_from_tracking_datasets(dataset_id, profile: gr.OAuthProfile | None):
 
399
 
400
  **Tip** *You can use a wildcard `*` to track all datasets for a user or organization on the hub. For example `biglam/*` will create alerts for all the datasets under the biglam Hugging Face Organization*
401
 
402
+ **You need to be logged in to your Hugging Face account to use this app.** If you don't have a Hugging Face Hub account you can get one <a href="https://huggingface.co/join">here</a>.
403
 
404
+ **NOTE** This app is a proof of concept and is intended to validate how much interest there is for a feature like this.
405
+ If you have feedback please add it to this [discussion]()
406
  """
407
 
408
  with gr.Blocks() as demo:
 
441
  user_stats_btn.click(user_stats, [], output)
442
  scheduler = BackgroundScheduler()
443
 
444
+ # if local:
445
+ scheduler.add_job(notify_about_new_models, "interval", minutes=30)
446
+ # else:
447
+ # scheduler.add_job(
448
+ # notify_about_new_models,
449
+ # CronTrigger.from_crontab("0 */12 * * *"),
450
+ # )
451
  scheduler.start()
452
  demo.queue(max_size=5)
453
  demo.launch()