Update app.py
Browse fileserror fix for custom theme
app.py
CHANGED
|
@@ -65,15 +65,14 @@ def predict_text(image):
|
|
| 65 |
with open("style.css", "r") as f:
|
| 66 |
custom_css = f.read()
|
| 67 |
|
| 68 |
-
# Create a
|
| 69 |
-
|
| 70 |
font=["Arial", "sans-serif"],
|
| 71 |
-
primary_hue="#e2cb92"
|
| 72 |
-
css=custom_css
|
| 73 |
)
|
| 74 |
|
| 75 |
-
# Gradio
|
| 76 |
-
with gr.Blocks(theme=
|
| 77 |
|
| 78 |
# Header
|
| 79 |
gr.Markdown(
|
|
@@ -102,6 +101,5 @@ with gr.Blocks(theme=custom_theme) as interface:
|
|
| 102 |
submit_button.click(fn=predict_text, inputs=image_input, outputs=output_text)
|
| 103 |
|
| 104 |
|
| 105 |
-
|
| 106 |
if __name__ == "__main__":
|
| 107 |
interface.launch()
|
|
|
|
| 65 |
with open("style.css", "r") as f:
|
| 66 |
custom_css = f.read()
|
| 67 |
|
| 68 |
+
# Create a base theme (without custom CSS)
|
| 69 |
+
theme_obj = gr.themes.Base(
|
| 70 |
font=["Arial", "sans-serif"],
|
| 71 |
+
primary_hue="#e2cb92" # GWU official gold as primary color
|
|
|
|
| 72 |
)
|
| 73 |
|
| 74 |
+
# Build Gradio interface with custom CSS applied via the Blocks css parameter
|
| 75 |
+
with gr.Blocks(theme=theme_obj, css=custom_css) as interface:
|
| 76 |
|
| 77 |
# Header
|
| 78 |
gr.Markdown(
|
|
|
|
| 101 |
submit_button.click(fn=predict_text, inputs=image_input, outputs=output_text)
|
| 102 |
|
| 103 |
|
|
|
|
| 104 |
if __name__ == "__main__":
|
| 105 |
interface.launch()
|