Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -247,7 +247,7 @@ def create_analysis_plots(symbol, days=180, lookback=30):
|
|
| 247 |
)
|
| 248 |
fig.update_layout(
|
| 249 |
height=1200,
|
| 250 |
-
title_text=f"
|
| 251 |
showlegend=True,
|
| 252 |
template="plotly_dark",
|
| 253 |
paper_bgcolor='rgba(0,0,0,0)',
|
|
@@ -255,7 +255,7 @@ def create_analysis_plots(symbol, days=180, lookback=30):
|
|
| 255 |
font=dict(size=12)
|
| 256 |
)
|
| 257 |
summary = f"""
|
| 258 |
-
###
|
| 259 |
|
| 260 |
#### Current Market Status
|
| 261 |
- **Current Price:** ${predictions['current_price']:,.2f}
|
|
@@ -275,7 +275,7 @@ def create_analysis_plots(symbol, days=180, lookback=30):
|
|
| 275 |
|
| 276 |
#### Prediction Confidence
|
| 277 |
- **Average Confidence:** {np.mean(predictions['confidence']) * 100:,.2f}%
|
| 278 |
-
- **Trend Direction:** {'
|
| 279 |
|
| 280 |
> *Note: Past performance does not guarantee future results. This analysis is for informational purposes only.*
|
| 281 |
"""
|
|
@@ -290,12 +290,12 @@ def create_analysis_plots(symbol, days=180, lookback=30):
|
|
| 290 |
y=0.5,
|
| 291 |
showarrow=False
|
| 292 |
)
|
| 293 |
-
return fig, f"
|
| 294 |
|
| 295 |
def create_interface():
|
| 296 |
with gr.Blocks(theme=gr.themes.Soft()) as iface:
|
| 297 |
gr.Markdown("""
|
| 298 |
-
#
|
| 299 |
|
| 300 |
This app uses deep learning to predict cryptocurrency prices and provide comprehensive market analysis.
|
| 301 |
|
|
@@ -325,7 +325,7 @@ def create_interface():
|
|
| 325 |
minimum=7, maximum=60, value=30, step=1,
|
| 326 |
label="Lookback Period (Days)"
|
| 327 |
)
|
| 328 |
-
submit_btn = gr.Button("
|
| 329 |
with gr.Column(scale=2):
|
| 330 |
plot_output = gr.Plot(label="Analysis Plots")
|
| 331 |
with gr.Row():
|
|
@@ -338,7 +338,7 @@ def create_interface():
|
|
| 338 |
return figure, summary, gr.update(visible=False, value="")
|
| 339 |
except Exception as e:
|
| 340 |
empty_fig = go.Figure()
|
| 341 |
-
error_msg = f"
|
| 342 |
return empty_fig, "", gr.update(visible=True, value=error_msg)
|
| 343 |
submit_btn.click(
|
| 344 |
fn=handle_analysis,
|
|
|
|
| 247 |
)
|
| 248 |
fig.update_layout(
|
| 249 |
height=1200,
|
| 250 |
+
title_text=f"📈 {symbol} Price Analysis Dashboard",
|
| 251 |
showlegend=True,
|
| 252 |
template="plotly_dark",
|
| 253 |
paper_bgcolor='rgba(0,0,0,0)',
|
|
|
|
| 255 |
font=dict(size=12)
|
| 256 |
)
|
| 257 |
summary = f"""
|
| 258 |
+
### 📊 Analysis Summary for {symbol}
|
| 259 |
|
| 260 |
#### Current Market Status
|
| 261 |
- **Current Price:** ${predictions['current_price']:,.2f}
|
|
|
|
| 275 |
|
| 276 |
#### Prediction Confidence
|
| 277 |
- **Average Confidence:** {np.mean(predictions['confidence']) * 100:,.2f}%
|
| 278 |
+
- **Trend Direction:** {'🔺 Upward' if predictions['predicted'][-1] > predictions['actual'][-1] else '🔻 Downward'}
|
| 279 |
|
| 280 |
> *Note: Past performance does not guarantee future results. This analysis is for informational purposes only.*
|
| 281 |
"""
|
|
|
|
| 290 |
y=0.5,
|
| 291 |
showarrow=False
|
| 292 |
)
|
| 293 |
+
return fig, f"⚠️ Error: {str(e)}"
|
| 294 |
|
| 295 |
def create_interface():
|
| 296 |
with gr.Blocks(theme=gr.themes.Soft()) as iface:
|
| 297 |
gr.Markdown("""
|
| 298 |
+
# 🚀 Advanced Cryptocurrency Price Prediction
|
| 299 |
|
| 300 |
This app uses deep learning to predict cryptocurrency prices and provide comprehensive market analysis.
|
| 301 |
|
|
|
|
| 325 |
minimum=7, maximum=60, value=30, step=1,
|
| 326 |
label="Lookback Period (Days)"
|
| 327 |
)
|
| 328 |
+
submit_btn = gr.Button("📊 Generate Analysis", variant="primary")
|
| 329 |
with gr.Column(scale=2):
|
| 330 |
plot_output = gr.Plot(label="Analysis Plots")
|
| 331 |
with gr.Row():
|
|
|
|
| 338 |
return figure, summary, gr.update(visible=False, value="")
|
| 339 |
except Exception as e:
|
| 340 |
empty_fig = go.Figure()
|
| 341 |
+
error_msg = f"⚠️ Error during analysis: {str(e)}"
|
| 342 |
return empty_fig, "", gr.update(visible=True, value=error_msg)
|
| 343 |
submit_btn.click(
|
| 344 |
fn=handle_analysis,
|