Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,6 +104,14 @@ def generate_summary(info, ratios):
|
|
| 104 |
return summary
|
| 105 |
|
| 106 |
def stock_research(symbol, assumed_eps=5.0, growth_rate=0.1, book_value=500000000):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
info = get_company_info(symbol)
|
| 108 |
price = get_current_price(symbol)
|
| 109 |
dividends = get_dividends(symbol)
|
|
@@ -133,9 +141,9 @@ iface = gr.Interface(
|
|
| 133 |
fn=stock_research,
|
| 134 |
inputs=[
|
| 135 |
gr.Textbox(label="Stock Symbol (e.g., AAPL)"),
|
| 136 |
-
gr.Number(label="Assumed EPS
|
| 137 |
-
gr.Number(label="Assumed Growth Rate
|
| 138 |
-
gr.Number(label="Assumed Book Value
|
| 139 |
],
|
| 140 |
outputs=[
|
| 141 |
gr.Textbox(label="AI Research Summary"),
|
|
|
|
| 104 |
return summary
|
| 105 |
|
| 106 |
def stock_research(symbol, assumed_eps=5.0, growth_rate=0.1, book_value=500000000):
|
| 107 |
+
# Safeguard against None values
|
| 108 |
+
if assumed_eps is None:
|
| 109 |
+
assumed_eps = 5.0
|
| 110 |
+
if growth_rate is None:
|
| 111 |
+
growth_rate = 0.1
|
| 112 |
+
if book_value is None:
|
| 113 |
+
book_value = 500000000
|
| 114 |
+
|
| 115 |
info = get_company_info(symbol)
|
| 116 |
price = get_current_price(symbol)
|
| 117 |
dividends = get_dividends(symbol)
|
|
|
|
| 141 |
fn=stock_research,
|
| 142 |
inputs=[
|
| 143 |
gr.Textbox(label="Stock Symbol (e.g., AAPL)"),
|
| 144 |
+
gr.Number(label="Assumed EPS", value=5.0),
|
| 145 |
+
gr.Number(label="Assumed Growth Rate", value=0.1),
|
| 146 |
+
gr.Number(label="Assumed Book Value", value=500000000)
|
| 147 |
],
|
| 148 |
outputs=[
|
| 149 |
gr.Textbox(label="AI Research Summary"),
|