Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -684,7 +684,7 @@ def add_export_section(df, stats, outliers, model):
|
|
| 684 |
st.session_state.csv_data = None
|
| 685 |
col1, col2, col3 = st.columns(3)
|
| 686 |
with col1:
|
| 687 |
-
if st.button("
|
| 688 |
try:
|
| 689 |
with st.spinner("Generating PDF with AI analysis..."):
|
| 690 |
st.session_state.pdf_buffer = create_enhanced_pdf_report(df, stats, outliers, model)
|
|
@@ -702,7 +702,7 @@ def add_export_section(df, stats, outliers, model):
|
|
| 702 |
key="download_pdf_btn"
|
| 703 |
)
|
| 704 |
with col2:
|
| 705 |
-
if st.button("
|
| 706 |
try:
|
| 707 |
st.session_state.csv_data = create_csv_export(df, stats)
|
| 708 |
st.success("✅ CSV summary generated successfully!")
|
|
@@ -720,11 +720,12 @@ def add_export_section(df, stats, outliers, model):
|
|
| 720 |
with col3:
|
| 721 |
csv_string = df.to_csv(index=False)
|
| 722 |
st.download_button(
|
| 723 |
-
label="
|
| 724 |
data=csv_string,
|
| 725 |
file_name=f"raw_production_data_{datetime.now().strftime('%Y%m%d_%H%M')}.csv",
|
| 726 |
mime="text/csv",
|
| 727 |
-
key="download_raw_btn"
|
|
|
|
| 728 |
)
|
| 729 |
|
| 730 |
def main():
|
|
|
|
| 684 |
st.session_state.csv_data = None
|
| 685 |
col1, col2, col3 = st.columns(3)
|
| 686 |
with col1:
|
| 687 |
+
if st.button("Generate PDF Report with AI", key="generate_pdf_btn", type="primary"):
|
| 688 |
try:
|
| 689 |
with st.spinner("Generating PDF with AI analysis..."):
|
| 690 |
st.session_state.pdf_buffer = create_enhanced_pdf_report(df, stats, outliers, model)
|
|
|
|
| 702 |
key="download_pdf_btn"
|
| 703 |
)
|
| 704 |
with col2:
|
| 705 |
+
if st.button("Generate CSV Summary", key="generate_csv_btn", type="primary"):
|
| 706 |
try:
|
| 707 |
st.session_state.csv_data = create_csv_export(df, stats)
|
| 708 |
st.success("✅ CSV summary generated successfully!")
|
|
|
|
| 720 |
with col3:
|
| 721 |
csv_string = df.to_csv(index=False)
|
| 722 |
st.download_button(
|
| 723 |
+
label="Download Raw Data",
|
| 724 |
data=csv_string,
|
| 725 |
file_name=f"raw_production_data_{datetime.now().strftime('%Y%m%d_%H%M')}.csv",
|
| 726 |
mime="text/csv",
|
| 727 |
+
key="download_raw_btn",
|
| 728 |
+
type="primary"
|
| 729 |
)
|
| 730 |
|
| 731 |
def main():
|