Spaces:
Sleeping
Sleeping
Add usage details in the interface
Browse files- utils/gradio_helper.py +10 -0
utils/gradio_helper.py
CHANGED
@@ -2,6 +2,14 @@ import gradio as gr
|
|
2 |
|
3 |
from .audio_palette import AudioPalette
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
def single_image_interface(model: AudioPalette):
|
6 |
demo = gr.Interface(
|
7 |
fn=model.generate_single,
|
@@ -69,6 +77,7 @@ def single_image_interface(model: AudioPalette):
|
|
69 |
cache_examples=False,
|
70 |
live=False,
|
71 |
description="Provide an image to generate an appropriate background soundtrack",
|
|
|
72 |
)
|
73 |
|
74 |
return demo
|
@@ -115,6 +124,7 @@ def multi_image_interface(model: AudioPalette):
|
|
115 |
cache_examples=False,
|
116 |
live=False,
|
117 |
description="Provide images to generate a slideshow of the images with appropriate music as background",
|
|
|
118 |
)
|
119 |
|
120 |
return demo
|
|
|
2 |
|
3 |
from .audio_palette import AudioPalette
|
4 |
|
5 |
+
article = """
|
6 |
+
### Usage
|
7 |
+
|
8 |
+
- Since this space is running on a CPU, it is not possible to generate music in a reasonable time.
|
9 |
+
- To address this, we have provided a python notebook (check Files) that handles the music generation part which can be run locally (if you have GPU) or elsewhere.
|
10 |
+
- This uses fastAPI to accept api requests and ngrok to expose the server. The same ngrok link needs to be pasted in the input box. (Make sure to include the trailing `/`).
|
11 |
+
"""
|
12 |
+
|
13 |
def single_image_interface(model: AudioPalette):
|
14 |
demo = gr.Interface(
|
15 |
fn=model.generate_single,
|
|
|
77 |
cache_examples=False,
|
78 |
live=False,
|
79 |
description="Provide an image to generate an appropriate background soundtrack",
|
80 |
+
article=article
|
81 |
)
|
82 |
|
83 |
return demo
|
|
|
124 |
cache_examples=False,
|
125 |
live=False,
|
126 |
description="Provide images to generate a slideshow of the images with appropriate music as background",
|
127 |
+
article=article
|
128 |
)
|
129 |
|
130 |
return demo
|