Update app.py
Browse files
app.py
CHANGED
@@ -173,8 +173,9 @@ body {
|
|
173 |
analyzer = ChartAnalyzer()
|
174 |
|
175 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
176 |
-
|
177 |
-
|
|
|
178 |
<div style="text-align: center; margin-bottom: 32px;">
|
179 |
<h1 style="color: var(--primary-color); font-size: 2.5rem; margin-bottom: 16px;">
|
180 |
π CryptoVision Pro
|
@@ -183,46 +184,36 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
|
183 |
Advanced AI-powered cryptocurrency technical analysis
|
184 |
</p>
|
185 |
</div>
|
|
|
186 |
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
with gr.Row():
|
207 |
-
with gr.Column(scale=1, elem_classes=["upload-box"]):
|
208 |
-
chart_input = gr.Image(
|
209 |
-
type="filepath",
|
210 |
-
label="",
|
211 |
-
sources=["upload"],
|
212 |
-
height=300
|
213 |
-
)
|
214 |
-
analyze_btn = gr.Button(
|
215 |
-
"Analyze Chart",
|
216 |
-
variant="primary",
|
217 |
-
elem_classes=["primary-button"]
|
218 |
-
)
|
219 |
-
|
220 |
-
with gr.Column(scale=2, elem_classes=["analysis-box"]):
|
221 |
-
analysis_output = gr.Markdown(
|
222 |
-
label="",
|
223 |
-
elem_classes=["markdown-container"]
|
224 |
-
)
|
225 |
-
|
226 |
analyze_btn.click(
|
227 |
fn=analyzer.analyze_chart,
|
228 |
inputs=chart_input,
|
@@ -230,4 +221,7 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
|
230 |
)
|
231 |
|
232 |
if __name__ == "__main__":
|
233 |
-
demo.launch(
|
|
|
|
|
|
|
|
173 |
analyzer = ChartAnalyzer()
|
174 |
|
175 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
176 |
+
# Header Section
|
177 |
+
with gr.Column(elem_classes=["container"]):
|
178 |
+
gr.Markdown("""
|
179 |
<div style="text-align: center; margin-bottom: 32px;">
|
180 |
<h1 style="color: var(--primary-color); font-size: 2.5rem; margin-bottom: 16px;">
|
181 |
π CryptoVision Pro
|
|
|
184 |
Advanced AI-powered cryptocurrency technical analysis
|
185 |
</p>
|
186 |
</div>
|
187 |
+
""")
|
188 |
|
189 |
+
# Main Content
|
190 |
+
with gr.Row():
|
191 |
+
# Upload Column
|
192 |
+
with gr.Column(elem_classes=["column"]):
|
193 |
+
with gr.Box(elem_classes=["upload-box"]):
|
194 |
+
gr.Markdown("### π€ Upload Your Chart")
|
195 |
+
chart_input = gr.Image(
|
196 |
+
type="filepath",
|
197 |
+
label="",
|
198 |
+
sources=["upload"],
|
199 |
+
height=300
|
200 |
+
)
|
201 |
+
analyze_btn = gr.Button(
|
202 |
+
"Analyze Chart",
|
203 |
+
variant="primary",
|
204 |
+
elem_classes=["primary-button"]
|
205 |
+
)
|
206 |
|
207 |
+
# Analysis Column
|
208 |
+
with gr.Column(elem_classes=["column"]):
|
209 |
+
with gr.Box(elem_classes=["analysis-box"]):
|
210 |
+
gr.Markdown("### π Analysis Report")
|
211 |
+
analysis_output = gr.Markdown(
|
212 |
+
label="",
|
213 |
+
elem_classes=["markdown-container"]
|
214 |
+
)
|
215 |
+
|
216 |
+
# Event Handling
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
analyze_btn.click(
|
218 |
fn=analyzer.analyze_chart,
|
219 |
inputs=chart_input,
|
|
|
221 |
)
|
222 |
|
223 |
if __name__ == "__main__":
|
224 |
+
demo.launch(
|
225 |
+
server_port=int(os.getenv("PORT", 7860)),
|
226 |
+
show_error=True
|
227 |
+
)
|