Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -56,14 +56,13 @@ def safe_request(url):
|
|
56 |
# (functions unchanged)
|
57 |
# ...
|
58 |
|
59 |
-
#
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
return None
|
67 |
|
68 |
# Fetch Functions
|
69 |
def get_company_info(symbol):
|
@@ -209,9 +208,7 @@ def stock_research(symbol, eps=5.0, growth=0.1, book=500000000):
|
|
209 |
return summary, info_table, ratios_table, sector_comp, fig
|
210 |
|
211 |
# Gradio UI
|
212 |
-
with gr.Blocks(theme=
|
213 |
-
theme_choice = gr.Radio(choices=["light", "dark"], value="light", label="Choose Theme")
|
214 |
-
|
215 |
with gr.Row():
|
216 |
symbol = gr.Textbox(label="Stock Symbol (e.g., AAPL)")
|
217 |
eps = gr.Number(label="Assumed EPS", value=5.0)
|
@@ -251,5 +248,6 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue")) as iface:
|
|
251 |
outputs=[output_summary, output_info, output_ratios, output_sector, output_chart])
|
252 |
|
253 |
|
|
|
254 |
if __name__ == "__main__":
|
255 |
iface.launch()
|
|
|
56 |
# (functions unchanged)
|
57 |
# ...
|
58 |
|
59 |
+
# Theme Selection
|
60 |
+
selected_theme = os.getenv("APP_THEME", "light")
|
61 |
+
if selected_theme == "dark":
|
62 |
+
theme = gr.themes.Base()
|
63 |
+
else:
|
64 |
+
theme = gr.themes.Soft(primary_hue="blue")
|
65 |
+
|
|
|
66 |
|
67 |
# Fetch Functions
|
68 |
def get_company_info(symbol):
|
|
|
208 |
return summary, info_table, ratios_table, sector_comp, fig
|
209 |
|
210 |
# Gradio UI
|
211 |
+
with gr.Blocks(theme=theme) as iface:
|
|
|
|
|
212 |
with gr.Row():
|
213 |
symbol = gr.Textbox(label="Stock Symbol (e.g., AAPL)")
|
214 |
eps = gr.Number(label="Assumed EPS", value=5.0)
|
|
|
248 |
outputs=[output_summary, output_info, output_ratios, output_sector, output_chart])
|
249 |
|
250 |
|
251 |
+
|
252 |
if __name__ == "__main__":
|
253 |
iface.launch()
|