Commit
•
e7f020c
1
Parent(s):
595ff42
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,8 @@ import gradio as gr
|
|
4 |
from pydantic_settings import BaseSettings
|
5 |
from tempfile import NamedTemporaryFile
|
6 |
import sweetviz as sv
|
7 |
-
from dataprep.datasets import load_dataset
|
8 |
-
from dataprep.eda import create_report
|
9 |
|
10 |
def generate_report(file, type):
|
11 |
df = pd.read_csv(file) if file.name.endswith(".csv") else pd.read_excel(file)
|
@@ -16,10 +16,10 @@ def generate_report(file, type):
|
|
16 |
temp_file1.close()
|
17 |
|
18 |
|
19 |
-
dataprep_report = create_report(df)
|
20 |
-
temp_file2 = NamedTemporaryFile(delete=False, suffix=".html")
|
21 |
-
temp_file2.write(dataprep_report.encode('utf-8'))
|
22 |
-
temp_file2.close()
|
23 |
|
24 |
|
25 |
|
@@ -47,5 +47,5 @@ with gr.Blocks() as cluster:
|
|
47 |
out2=gr.File(label="Download CSV")
|
48 |
gr.HTML(html_content="""<h1 style="color: #3399FF; text-shadow: 1px 1px 2px #ddd;">SWEETVIZ REPORT</h1>""")
|
49 |
out3=gr.File(label="Download CSV")
|
50 |
-
btn.click(generate_report,inputs=[file,type],outputs=[out1,
|
51 |
cluster.launch()
|
|
|
4 |
from pydantic_settings import BaseSettings
|
5 |
from tempfile import NamedTemporaryFile
|
6 |
import sweetviz as sv
|
7 |
+
# from dataprep.datasets import load_dataset
|
8 |
+
# from dataprep.eda import create_report
|
9 |
|
10 |
def generate_report(file, type):
|
11 |
df = pd.read_csv(file) if file.name.endswith(".csv") else pd.read_excel(file)
|
|
|
16 |
temp_file1.close()
|
17 |
|
18 |
|
19 |
+
# dataprep_report = create_report(df)
|
20 |
+
# temp_file2 = NamedTemporaryFile(delete=False, suffix=".html")
|
21 |
+
# temp_file2.write(dataprep_report.encode('utf-8'))
|
22 |
+
# temp_file2.close()
|
23 |
|
24 |
|
25 |
|
|
|
47 |
out2=gr.File(label="Download CSV")
|
48 |
gr.HTML(html_content="""<h1 style="color: #3399FF; text-shadow: 1px 1px 2px #ddd;">SWEETVIZ REPORT</h1>""")
|
49 |
out3=gr.File(label="Download CSV")
|
50 |
+
btn.click(generate_report,inputs=[file,type],outputs=[out1,out3])
|
51 |
cluster.launch()
|