Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,8 @@ import yt_dlp
|
|
30 |
# 2. Usage of/Hardcoding HF_TOKEN as token for API calls
|
31 |
# 3. Usage of HuggingFace for Inference
|
32 |
# 4. Other stuff I can't remember. Will eventually do a diff and document them.
|
33 |
-
#
|
|
|
34 |
|
35 |
|
36 |
|
@@ -1200,7 +1201,22 @@ def launch_ui(demo_mode=False):
|
|
1200 |
return "\n".join([item["text"] for item in json_data])
|
1201 |
else:
|
1202 |
return ""
|
1203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1204 |
inputs = [
|
1205 |
gr.components.Textbox(label="URL"),
|
1206 |
gr.components.Number(value=2, label="Number of Speakers"),
|
|
|
30 |
# 2. Usage of/Hardcoding HF_TOKEN as token for API calls
|
31 |
# 3. Usage of HuggingFace for Inference
|
32 |
# 4. Other stuff I can't remember. Will eventually do a diff and document them.
|
33 |
+
# 5. Dark mode changes under gradio
|
34 |
+
#
|
35 |
|
36 |
|
37 |
|
|
|
1201 |
return "\n".join([item["text"] for item in json_data])
|
1202 |
else:
|
1203 |
return ""
|
1204 |
+
with gr.Blocks(theme='bethecloud/storj_theme') as demo:
|
1205 |
+
with gr.Column(scale=3):
|
1206 |
+
with gr.Box():
|
1207 |
+
dropdown.render()
|
1208 |
+
toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
|
1209 |
+
dropdown.change(None, dropdown, None, _js=js)
|
1210 |
+
toggle_dark.click(
|
1211 |
+
None,
|
1212 |
+
_js="""
|
1213 |
+
() => {
|
1214 |
+
document.body.classList.toggle('dark');
|
1215 |
+
document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
|
1216 |
+
}
|
1217 |
+
""",
|
1218 |
+
)
|
1219 |
+
|
1220 |
inputs = [
|
1221 |
gr.components.Textbox(label="URL"),
|
1222 |
gr.components.Number(value=2, label="Number of Speakers"),
|