Skip to content

Commit b8cae31

Browse files
Misc improvement of Spaces docs (#443)
* Update spaces docs * Apply suggestions from code review Co-authored-by: Steven Liu <[email protected]> * Final minor changes Co-authored-by: Steven Liu <[email protected]>
1 parent e701af7 commit b8cae31

File tree

1 file changed

+35
-27
lines changed

1 file changed

+35
-27
lines changed

docs/hub/spaces.md

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,21 @@ title: Documentation for Spaces
44

55
<h1>How to get started with Spaces</h1>
66

7-
<div class="p-4 border border-gray-200 rounded-lg">
8-
⚠️ This feature is currently in private beta, <a style="font-weight: bold !important" href="/spaces">sign up to the waiting list</a> or <a href="#how-can-i-contact-you">reach out to us</a> if you'd like to try it out ⚠️
9-
</div>
10-
117
## What are Spaces?
128

13-
Spaces are a simple way to host ML demo apps directly on your profile or your organization’s profile.
9+
Spaces are a simple way to host ML demo apps directly on your profile or your organization’s profile. This allows you to create your ML portfolio, showcase your projects at conferences or to stakeholders, and work collaboratively with other people in the ML ecosystem.
1410

1511
We support two awesome SDKs that let you build cool apps in Python in a matter of minutes: **[Streamlit](https://streamlit.io/)** and **[Gradio](https://gradio.app/)**.
1612

17-
**To get started**, simply click on [New Space](https://huggingface.co/new-space) in the top navigation menu, create a new repo of type `Space`, and pick your SDK:
18-
19-
![/docs/assets/hub/new-space.gif](/docs/assets/hub/new-space.gif)
20-
21-
Under the hood, we store your code inside a git repository just as done for model and dataset repositories. Thanks to this, the same tools you're already used to (`git` and `git-lfs`) will also work for Spaces.
13+
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/3bSVKNKb_PY" title="Spaces intro" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
2214

23-
Each time you commit, we deploy a containerized version of your code on our Infra. More details below!
15+
**To get started**, simply click on [New Space](https://huggingface.co/new-space) in the top navigation menu, create a new repo of type `Space`, and pick your SDK.
2416

25-
<!-- TODO(have someone record a Youtube demo of Spaces showcasing some cool apps already running, etc) -->
17+
Under the hood, Spaces stores your code inside a git repository, just like the model and dataset repositories. Thanks to this, the same tools you're already used to (`git` and `git-lfs`) also work for Spaces.
2618

2719
## Should I use Streamlit or Gradio?
2820

29-
We recommend you try both as they're both really awesome! 😎
21+
We recommend you try both because they're really awesome! 😎
3022

3123
Streamlit's documentation is at https://docs.streamlit.io/ and Gradio's doc is at https://gradio.app/getting_started.
3224

@@ -78,26 +70,35 @@ We deploy a containerized version of your code on our Infra, each time you commi
7870

7971
If your app needs any secret keys or tokens to run, you do not want to hardcode them inside your code! Instead, head over to the settings page of your Space repo, and you'll be able to input key/secret pairs.
8072

81-
Those secrets will be exposed to your app using the [Streamlit Secrets](https://blog.streamlit.io/secrets-in-sharing-apps/) feature if it's a Streamlit app, or as env variables in other cases.
73+
Secrets will be exposed to your app using the [Streamlit Secrets](https://blog.streamlit.io/secrets-in-sharing-apps/) feature if it's a Streamlit app, or as environment variables in other cases.
8274

83-
## Streamlit advanced features
8475

85-
We support those Streamlit features transparently:
76+
## I am having issues with Streamlit versions!
8677

87-
- `st.experimental_get_query_params()` and `st.experimental_set_query_params(**parameter)` to manage app state in the url
88-
- if something doesn't work, please [reach out](#how-can-i-contact-you).
78+
The Streamlit version is not configured in the `requirements.txt` file, but rather in the README metadata config through the `sdk_version` setting. Not all Streamlit versions are supported. Refer to the [reference section](#reference) for more information about which versions are supported.
8979

90-
## I am having issues with Streamlit versions!
80+
## Can I use my own HTML instead of Streamlit or Gradio?
9181

92-
The Streamlit version is not configured in the `requirements.txt` file, but in the README metadata config through the `sdk_version` setting. Note that we do not support all Streamlit versions, please refer to the [reference section](#reference) for more info on this.
82+
Although we strongly encourage you to use Streamlit and Gradio, you can also use your own HTML
83+
code by defining `sdk: static` and having the HTML within an `index.html` file. Here are some examples:
9384

94-
## How can I contact you?
85+
* [Smarter NPC](https://huggingface.co/spaces/mishig/smarter_npc): Display a PlayCanvas project with an iframe.
86+
* [Huggingfab](https://huggingface.co/spaces/pierreant-p/huggingfab): Display a Sketchfab model in Spaces.
9587

96-
Feel free to ask question in the [Forum](https://discuss.huggingface.co/) if it's suitable for the community.
88+
Please [get in touch](#how-can-i-contact-you) if you have an idea for cool static Spaces.
9789

98-
If you're interested in infra challenges, custom demos, GPU or something else, please reach out to us by sending an email to website at huggingface.co.
9990

100-
You can also tag us [on Twitter](https://twitter.com/huggingface)!
91+
## Building an organization card
92+
93+
Create an organization card to help users learn more about what your organization is working on and how users can use your libraries, models, datasets, and Spaces. Build an organization card by creating a static README Space with HTML. As an example, take a look at the [Amazon](https://huggingface.co/spaces/amazon/README/blob/main/README.md) and [spaCy](https://huggingface.co/spaces/spacy/README/blob/main/README.md) organization cards.
94+
95+
* https://huggingface.co/spaces/spacy/README/blob/main/README.md
96+
* https://huggingface.co/spaces/amazon/README/blob/main/README.md
97+
98+
99+
## Can I use Bokeh?
100+
101+
Streamlit has built-in support for Bokeh with the `st.bokeh_chart` component.
101102

102103
## How should I link my Spaces demo in my GitHub repo?
103104

@@ -157,7 +158,7 @@ Color for Thumbnail gradient (red, yellow, green, blue, indigo, purple, pink, gr
157158
Color for Thumbnail gradient (red, yellow, green, blue, indigo, purple, pink, gray)
158159

159160
**`sdk`** : _string_
160-
Can be either `gradio` or `streamlit`
161+
Can be either `gradio`, `streamlit` or `static`
161162

162163
**`sdk_version`** : _string_
163164
Only applicable for `streamlit` SDK. Currently available versions are :
@@ -170,10 +171,9 @@ Path is relative to the root of the repository.
170171
**`pinned`** : _boolean_
171172
Whether the Space stays on top of your list.
172173

173-
174174
## How can I manage my app through Github
175175

176-
You can keep your app in sync with your GitHub repository by leveraging GitHub Actions:
176+
Keep your app in sync with your GitHub repository with GitHub Actions:
177177

178178
- We require Git LFS for files above 10MB so you may need to review your files if you don't want to use Git LFS. This includes your history. You can use handy tools such as [BFG Repo-Cleaner](https://rtyley.github.io/bfg-repo-cleaner/) to remove the large files from your history (keep a local copy of your repository for backup).
179179
- Set your GitHub repository and your Spaces app initially in sync: to add your Spaces app as an additional remote to your existing git repository, you can use the command `git remote add space https://huggingface.co/spaces/FULL_SPACE_NAME`. You can then force-push to sync everything for the first time: `git push --force space main`
@@ -225,6 +225,14 @@ jobs:
225225

226226
```
227227

228+
## How can I contact you?
229+
230+
Feel free to ask questions on the [forum](https://discuss.huggingface.co/) if it's suitable for the community.
231+
232+
If you're interested in infra challenges, custom demos, GPUs, or something else, please reach out to us by sending an email to **website at huggingface.co**.
233+
234+
You can also tag us [on Twitter](https://twitter.com/huggingface)!
235+
228236
## Changelog
229237

230238
#### [2021-10-20] - Add support for Streamlit 1.0

0 commit comments

Comments
 (0)