Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
d4e77f2
1
Parent(s):
3701087
make scheduler 30 mins for testing
Browse files
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 |
-
**
|
|
|
|
| 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 |
-
|
| 444 |
-
else:
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 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()
|