Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
|
|
|
| 3 |
css = """
|
| 4 |
:root {
|
| 5 |
--bg-primary: #0a0a0a;
|
|
@@ -12,7 +13,6 @@ css = """
|
|
| 12 |
--accent-blue: #3b82f6;
|
| 13 |
--gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
| 14 |
}
|
| 15 |
-
/* Only change colors, not spacing */
|
| 16 |
.gradio-container {
|
| 17 |
background: var(--bg-primary) !important;
|
| 18 |
color: var(--text-primary) !important;
|
|
@@ -82,23 +82,6 @@ css = """
|
|
| 82 |
background: var(--accent-blue) !important;
|
| 83 |
color: white !important;
|
| 84 |
}
|
| 85 |
-
/* Tab styling */
|
| 86 |
-
button[role="tab"] {
|
| 87 |
-
background: transparent !important;
|
| 88 |
-
color: var(--text-secondary) !important;
|
| 89 |
-
border: none !important;
|
| 90 |
-
border-radius: 8px !important;
|
| 91 |
-
font-weight: 500 !important;
|
| 92 |
-
transition: all 0.2s ease !important;
|
| 93 |
-
}
|
| 94 |
-
button[role="tab"]:hover {
|
| 95 |
-
background: var(--bg-hover) !important;
|
| 96 |
-
color: var(--text-primary) !important;
|
| 97 |
-
}
|
| 98 |
-
button[role="tab"][aria-selected="true"] {
|
| 99 |
-
background: var(--accent-blue) !important;
|
| 100 |
-
color: white !important;
|
| 101 |
-
}
|
| 102 |
/* Card backgrounds */
|
| 103 |
.gr-group {
|
| 104 |
background: var(--bg-card) !important;
|
|
@@ -120,6 +103,34 @@ css = """
|
|
| 120 |
border-radius: 50% !important;
|
| 121 |
cursor: pointer !important;
|
| 122 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
/* Info message */
|
| 124 |
.info-message {
|
| 125 |
background: rgba(59, 130, 246, 0.1);
|
|
@@ -135,14 +146,16 @@ css = """
|
|
| 135 |
padding: 3rem 0 2rem;
|
| 136 |
margin-top: 4rem;
|
| 137 |
border-top: 1px solid var(--border-color);
|
|
|
|
|
|
|
|
|
|
| 138 |
color: var(--text-secondary) !important;
|
| 139 |
}
|
| 140 |
-
|
| 141 |
-
|
|
|
|
| 142 |
}
|
| 143 |
-
footer, #huggingface-space-header, huggingface-space-header { display: none !important; }
|
| 144 |
"""
|
| 145 |
-
|
| 146 |
token = os.environ["TOKEN"]
|
| 147 |
model=os.environ["MODEL"]
|
| 148 |
with gr.Blocks(fill_height=False,fill_width=False,css=css,js="""
|
|
@@ -154,6 +167,15 @@ with gr.Blocks(fill_height=False,fill_width=False,css=css,js="""
|
|
| 154 |
link.href = 'https://cms.cypherchat.app/uploads/favicon_8bc904ca6b.svg';
|
| 155 |
document.getElementsByTagName('head')[0].appendChild(link);
|
| 156 |
}
|
| 157 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
loaded_demo = gr.load(model, src="spaces", token=token)
|
| 159 |
demo.launch(show_api=False, show_error=False, quiet=True, debug=False)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
+
|
| 4 |
css = """
|
| 5 |
:root {
|
| 6 |
--bg-primary: #0a0a0a;
|
|
|
|
| 13 |
--accent-blue: #3b82f6;
|
| 14 |
--gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
| 15 |
}
|
|
|
|
| 16 |
.gradio-container {
|
| 17 |
background: var(--bg-primary) !important;
|
| 18 |
color: var(--text-primary) !important;
|
|
|
|
| 82 |
background: var(--accent-blue) !important;
|
| 83 |
color: white !important;
|
| 84 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
/* Card backgrounds */
|
| 86 |
.gr-group {
|
| 87 |
background: var(--bg-card) !important;
|
|
|
|
| 103 |
border-radius: 50% !important;
|
| 104 |
cursor: pointer !important;
|
| 105 |
}
|
| 106 |
+
/* Audio upload styling */
|
| 107 |
+
.gr-audio {
|
| 108 |
+
background: var(--bg-secondary) !important;
|
| 109 |
+
border: 1px solid var(--border-color) !important;
|
| 110 |
+
border-radius: 8px !important;
|
| 111 |
+
}
|
| 112 |
+
/* Label styling */
|
| 113 |
+
label {
|
| 114 |
+
color: var(--text-secondary) !important;
|
| 115 |
+
font-weight: 500 !important;
|
| 116 |
+
margin-bottom: 0.5rem !important;
|
| 117 |
+
}
|
| 118 |
+
/* Accordion styling */
|
| 119 |
+
.gr-accordion {
|
| 120 |
+
background: var(--bg-card) !important;
|
| 121 |
+
border: 1px solid var(--border-color) !important;
|
| 122 |
+
border-radius: 8px !important;
|
| 123 |
+
}
|
| 124 |
+
button.gr-accordion-header {
|
| 125 |
+
background: transparent !important;
|
| 126 |
+
color: var(--text-primary) !important;
|
| 127 |
+
border: none !important;
|
| 128 |
+
padding: 1rem !important;
|
| 129 |
+
font-weight: 500 !important;
|
| 130 |
+
}
|
| 131 |
+
button.gr-accordion-header:hover {
|
| 132 |
+
background: var(--bg-hover) !important;
|
| 133 |
+
}
|
| 134 |
/* Info message */
|
| 135 |
.info-message {
|
| 136 |
background: rgba(59, 130, 246, 0.1);
|
|
|
|
| 146 |
padding: 3rem 0 2rem;
|
| 147 |
margin-top: 4rem;
|
| 148 |
border-top: 1px solid var(--border-color);
|
| 149 |
+
color: var(--text-secondary);
|
| 150 |
+
}
|
| 151 |
+
a {
|
| 152 |
color: var(--text-secondary) !important;
|
| 153 |
}
|
| 154 |
+
/* Hide default Gradio branding */
|
| 155 |
+
#huggingface-space-header, footer, huggingface-space-header {
|
| 156 |
+
display: none !important;
|
| 157 |
}
|
|
|
|
| 158 |
"""
|
|
|
|
| 159 |
token = os.environ["TOKEN"]
|
| 160 |
model=os.environ["MODEL"]
|
| 161 |
with gr.Blocks(fill_height=False,fill_width=False,css=css,js="""
|
|
|
|
| 167 |
link.href = 'https://cms.cypherchat.app/uploads/favicon_8bc904ca6b.svg';
|
| 168 |
document.getElementsByTagName('head')[0].appendChild(link);
|
| 169 |
}
|
| 170 |
+
""",theme=gr.themes.Default(
|
| 171 |
+
primary_hue="blue",
|
| 172 |
+
neutral_hue="gray",
|
| 173 |
+
text_size="md"
|
| 174 |
+
).set(
|
| 175 |
+
body_background_fill="#0a0a0a",
|
| 176 |
+
body_background_fill_dark="#0a0a0a",
|
| 177 |
+
block_background_fill="#1a1a1a",
|
| 178 |
+
block_background_fill_dark="#1a1a1a"
|
| 179 |
+
)) as demo:
|
| 180 |
loaded_demo = gr.load(model, src="spaces", token=token)
|
| 181 |
demo.launch(show_api=False, show_error=False, quiet=True, debug=False)
|