Update app.py
Browse filesAdded a few minor suggestions to make text a little cleaner/clearer! Super cool demo 💯
app.py
CHANGED
|
@@ -23,12 +23,12 @@ def _get_demo_code(path: str) -> str:
|
|
| 23 |
DEMO_EXPLANATION = """
|
| 24 |
<h1 style='text-align: center; margin-bottom: 1rem'> How to persist data from a Space to a Dataset? </h1>
|
| 25 |
|
| 26 |
-
This demo shows how to leverage
|
| 27 |
When doing so, a few things must be taken care of: file formats, concurrent writes, name collision, number of commits,
|
| 28 |
-
number of files
|
| 29 |
complexity and usage of your app, you might want to use one or the other.
|
| 30 |
|
| 31 |
-
This Space comes as a demo for this `huggingface_hub` guide
|
| 32 |
"""
|
| 33 |
|
| 34 |
JSON_DEMO_EXPLANATION = """
|
|
@@ -47,7 +47,7 @@ Works with concurrent users and replicas.
|
|
| 47 |
|
| 48 |
## Limitations
|
| 49 |
|
| 50 |
-
|
| 51 |
|
| 52 |
## Demo
|
| 53 |
"""
|
|
@@ -55,7 +55,7 @@ if you expect millions of lines, you will need to split the local JSON file into
|
|
| 55 |
IMAGE_DEMO_EXPLANATION = """
|
| 56 |
## Use case
|
| 57 |
|
| 58 |
-
Save images with metadata (caption, parameters, datetime
|
| 59 |
|
| 60 |
## Robustness
|
| 61 |
|
|
@@ -63,8 +63,8 @@ Works with concurrent users and replicas.
|
|
| 63 |
|
| 64 |
## Limitations
|
| 65 |
|
| 66 |
-
- only 10k images/folder supported on the Hub. If you expect more usage, you must save data in subfolders.
|
| 67 |
-
- only 1M images/repo supported on the Hub. If you expect more usage, you can zip your data before
|
| 68 |
|
| 69 |
## Demo
|
| 70 |
"""
|
|
@@ -72,7 +72,7 @@ Works with concurrent users and replicas.
|
|
| 72 |
IMAGE_1M_DEMO_EXPLANATION = """
|
| 73 |
## Use case:
|
| 74 |
|
| 75 |
-
|
| 76 |
|
| 77 |
## Robustness
|
| 78 |
|
|
|
|
| 23 |
DEMO_EXPLANATION = """
|
| 24 |
<h1 style='text-align: center; margin-bottom: 1rem'> How to persist data from a Space to a Dataset? </h1>
|
| 25 |
|
| 26 |
+
This demo shows how to leverage `gradio` and `huggingface_hub` to save data from a Space to a Dataset on the Hub.
|
| 27 |
When doing so, a few things must be taken care of: file formats, concurrent writes, name collision, number of commits,
|
| 28 |
+
number of files, and more. The tabs below show different ways of implementing a "save to dataset" feature. Depending on the
|
| 29 |
complexity and usage of your app, you might want to use one or the other.
|
| 30 |
|
| 31 |
+
This Space comes as a demo for this `huggingface_hub` [guide](https://huggingface.co/docs/huggingface_hub/main/en/guides/upload#scheduled-uploads). Please check it out if you need more technical details.
|
| 32 |
"""
|
| 33 |
|
| 34 |
JSON_DEMO_EXPLANATION = """
|
|
|
|
| 47 |
|
| 48 |
## Limitations
|
| 49 |
|
| 50 |
+
If you expect millions of lines, you must split the local JSON file into multiple files to avoid getting your file tracked as LFS (5MB) on the Hub.
|
| 51 |
|
| 52 |
## Demo
|
| 53 |
"""
|
|
|
|
| 55 |
IMAGE_DEMO_EXPLANATION = """
|
| 56 |
## Use case
|
| 57 |
|
| 58 |
+
Save images with metadata (caption, parameters, datetime, etc.).
|
| 59 |
|
| 60 |
## Robustness
|
| 61 |
|
|
|
|
| 63 |
|
| 64 |
## Limitations
|
| 65 |
|
| 66 |
+
- only 10k images/folder are supported on the Hub. If you expect more usage, you must save data in subfolders.
|
| 67 |
+
- only 1M images/repo supported on the Hub. If you expect more usage, you can zip your data before uploading. See the _1M images Dataset_ demo.
|
| 68 |
|
| 69 |
## Demo
|
| 70 |
"""
|
|
|
|
| 72 |
IMAGE_1M_DEMO_EXPLANATION = """
|
| 73 |
## Use case:
|
| 74 |
|
| 75 |
+
Save 1M images with metadata (caption, parameters, datetime, etc.).
|
| 76 |
|
| 77 |
## Robustness
|
| 78 |
|