Update main.py
Browse files
main.py
CHANGED
@@ -155,9 +155,10 @@ def main():
|
|
155 |
if st.session_state.ai_recommendations is None:
|
156 |
with st.spinner("Generating MTSS.ai analysis..."):
|
157 |
llm_input = ai_analysis.prepare_llm_input(student_metrics_df)
|
|
|
158 |
recommendations = ai_analysis.prompt_response_from_mistral_llm(llm_input)
|
159 |
st.session_state.ai_recommendations = recommendations
|
160 |
-
|
161 |
# Display the recommendations
|
162 |
st.subheader("MTSS.ai Analysis")
|
163 |
# st.markdown(recommendations)
|
@@ -182,30 +183,25 @@ def main():
|
|
182 |
# )
|
183 |
|
184 |
# Generate the PDF Report using the stored recommendations
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
)
|
192 |
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
|
203 |
except Exception as e:
|
204 |
st.error(f"Error processing the file: {str(e)}")
|
205 |
|
206 |
if __name__ == '__main__':
|
207 |
-
main()
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
|
|
155 |
if st.session_state.ai_recommendations is None:
|
156 |
with st.spinner("Generating MTSS.ai analysis..."):
|
157 |
llm_input = ai_analysis.prepare_llm_input(student_metrics_df)
|
158 |
+
# recommendations = ai_analysis.prompt_response_from_hf_llm(llm_input)
|
159 |
recommendations = ai_analysis.prompt_response_from_mistral_llm(llm_input)
|
160 |
st.session_state.ai_recommendations = recommendations
|
161 |
+
|
162 |
# Display the recommendations
|
163 |
st.subheader("MTSS.ai Analysis")
|
164 |
# st.markdown(recommendations)
|
|
|
183 |
# )
|
184 |
|
185 |
# Generate the PDF Report using the stored recommendations
|
186 |
+
report_gen = ReportGenerator()
|
187 |
+
combined_pdf = report_gen.create_combined_pdf(
|
188 |
+
intervention_fig,
|
189 |
+
student_metrics_fig,
|
190 |
+
st.session_state.ai_recommendations
|
191 |
+
)
|
|
|
192 |
|
193 |
+
# Add the download button for the PDF
|
194 |
+
st.download_button(
|
195 |
+
label="Download MTSS.ai Report (PDF)",
|
196 |
+
data=combined_pdf,
|
197 |
+
file_name="combined_report.pdf",
|
198 |
+
mime="application/pdf",
|
199 |
+
icon="📄",
|
200 |
+
use_container_width=True
|
201 |
+
)
|
202 |
|
203 |
except Exception as e:
|
204 |
st.error(f"Error processing the file: {str(e)}")
|
205 |
|
206 |
if __name__ == '__main__':
|
207 |
+
main()
|
|
|
|
|
|
|
|