Spaces:
Running
Running
readme
Browse files
README.md
CHANGED
@@ -29,21 +29,26 @@ Want more? Please open an issue in the [Community Tab](https://huggingface.co/sp
|
|
29 |
|
30 |
Integrate *Gradio User History* in just a few steps:
|
31 |
|
32 |
-
1. Enable OAuth
|
|
|
33 |
|
34 |
```yaml
|
35 |
# README.md
|
36 |
hf_oauth: true
|
37 |
```
|
38 |
|
39 |
-
|
|
|
|
|
40 |
|
41 |
```bash
|
42 |
# requirements.txt
|
43 |
git+https://huggingface.co/spaces/Wauplin/gradio-user-history
|
44 |
```
|
45 |
|
46 |
-
|
|
|
|
|
47 |
|
48 |
```py
|
49 |
# app.py
|
@@ -64,12 +69,12 @@ def generate(prompt: str, profile: gr.OAuthProfile | None):
|
|
64 |
with gr.Blocks() as demo:
|
65 |
(...)
|
66 |
|
67 |
-
# or `with gr.Tab("Past generations"):`
|
68 |
with gr.Accordion("Past generations", open=False):
|
69 |
gr_user_history.render()
|
70 |
```
|
71 |
|
72 |
-
|
|
|
73 |
Persistent Storage is suggested but not mandatory. If not enabled, the history is lost each time the Space restarts.
|
74 |
|
75 |
And you're done!
|
|
|
29 |
|
30 |
Integrate *Gradio User History* in just a few steps:
|
31 |
|
32 |
+
**1. Enable OAuth**
|
33 |
+
|
34 |
|
35 |
```yaml
|
36 |
# README.md
|
37 |
hf_oauth: true
|
38 |
```
|
39 |
|
40 |
+
|
41 |
+
**2. Add dependency to your `requirements.txt`**
|
42 |
+
|
43 |
|
44 |
```bash
|
45 |
# requirements.txt
|
46 |
git+https://huggingface.co/spaces/Wauplin/gradio-user-history
|
47 |
```
|
48 |
|
49 |
+
|
50 |
+
**3. Integrate into your Gradio app**
|
51 |
+
|
52 |
|
53 |
```py
|
54 |
# app.py
|
|
|
69 |
with gr.Blocks() as demo:
|
70 |
(...)
|
71 |
|
|
|
72 |
with gr.Accordion("Past generations", open=False):
|
73 |
gr_user_history.render()
|
74 |
```
|
75 |
|
76 |
+
|
77 |
+
**4. (optional) Add Persistent Storage in your Space settings.**
|
78 |
Persistent Storage is suggested but not mandatory. If not enabled, the history is lost each time the Space restarts.
|
79 |
|
80 |
And you're done!
|