Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import os
|
2 |
from sklearn.linear_model import LinearRegression # <-- Add this line
|
3 |
import random
|
|
|
4 |
import shutil
|
5 |
import base64
|
6 |
import gradio as gr
|
@@ -302,9 +303,11 @@ def analyze_face(input_data):
|
|
302 |
current_patient_details['id']
|
303 |
)
|
304 |
|
305 |
-
# Generate PDF
|
306 |
pdf_filename = f"Health_Report_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.pdf"
|
307 |
-
|
|
|
|
|
308 |
|
309 |
if pdf_filepath:
|
310 |
# Copy the PDF to a temporary directory for Gradio to serve it
|
|
|
1 |
import os
|
2 |
from sklearn.linear_model import LinearRegression # <-- Add this line
|
3 |
import random
|
4 |
+
import os
|
5 |
import shutil
|
6 |
import base64
|
7 |
import gradio as gr
|
|
|
303 |
current_patient_details['id']
|
304 |
)
|
305 |
|
306 |
+
# Generate PDF filename dynamically
|
307 |
pdf_filename = f"Health_Report_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.pdf"
|
308 |
+
|
309 |
+
# Pass the pdf_filename along with test_results to save_results_to_pdf
|
310 |
+
pdf_result, pdf_filepath = save_results_to_pdf(current_patient_details, test_results, pdf_filename)
|
311 |
|
312 |
if pdf_filepath:
|
313 |
# Copy the PDF to a temporary directory for Gradio to serve it
|