Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,10 +19,10 @@ def analyze_datasets(dataset, dataset_name, token, column=None, pairwise="off"):
|
|
19 |
analyze_report = sv.analyze(df, target_feat=column, pairwise_analysis=pairwise)
|
20 |
else:
|
21 |
analyze_report = sv.analyze(df, pairwise_analysis=pairwise)
|
22 |
-
analyze_report.show_html('index.html', open_browser=False)
|
23 |
repo_url = create_repo(f"{username}/{dataset_name}", repo_type = "space", token = token, space_sdk = "static", private=False)
|
24 |
|
25 |
-
upload_file(path_or_fileobj ="./index.html", path_in_repo = "./
|
26 |
readme = f"---\ntitle: {dataset_name}\nemoji: β¨\ncolorFrom: green\ncolorTo: red\nsdk: static\npinned: false\ntags:\n- dataset-report\n---"
|
27 |
with open("README.md", "w+") as f:
|
28 |
f.write(readme)
|
@@ -84,7 +84,7 @@ def train_baseline(dataset, dataset_name, token, column):
|
|
84 |
readme+= f"{elem}\n\n"
|
85 |
readme+= "\n\n**See model plot below:**\n\n"
|
86 |
readme+= re.sub(r"\n\s+", "", str(estimator_html_repr(fc.est_)))
|
87 |
-
readme+= "\n\nThis model is trained with dabl library as a baseline, for better results, use AutoTrain.\n\n"
|
88 |
with open(f"{tmpdirname}/README.md", "w+") as f:
|
89 |
f.write(readme)
|
90 |
with open(f"{tmpdirname}/clf.pkl", mode="bw") as f:
|
@@ -97,7 +97,7 @@ def train_baseline(dataset, dataset_name, token, column):
|
|
97 |
|
98 |
with gr.Blocks() as demo:
|
99 |
main_title = gr.Markdown("""# Baseline Trainer πͺπβ¨""")
|
100 |
-
main_desc = gr.Markdown("""This app trains a baseline model for a given dataset and pushes it to your Hugging Face Hub Profile with a model card. For better results, use AutoTrain.""")
|
101 |
|
102 |
|
103 |
with gr.Tabs():
|
|
|
19 |
analyze_report = sv.analyze(df, target_feat=column, pairwise_analysis=pairwise)
|
20 |
else:
|
21 |
analyze_report = sv.analyze(df, pairwise_analysis=pairwise)
|
22 |
+
analyze_report.show_html('./index.html', open_browser=False)
|
23 |
repo_url = create_repo(f"{username}/{dataset_name}", repo_type = "space", token = token, space_sdk = "static", private=False)
|
24 |
|
25 |
+
upload_file(path_or_fileobj ="./index.html", path_in_repo = "./", repo_id =f"{username}/{dataset_name}", repo_type = "space", token=token)
|
26 |
readme = f"---\ntitle: {dataset_name}\nemoji: β¨\ncolorFrom: green\ncolorTo: red\nsdk: static\npinned: false\ntags:\n- dataset-report\n---"
|
27 |
with open("README.md", "w+") as f:
|
28 |
f.write(readme)
|
|
|
84 |
readme+= f"{elem}\n\n"
|
85 |
readme+= "\n\n**See model plot below:**\n\n"
|
86 |
readme+= re.sub(r"\n\s+", "", str(estimator_html_repr(fc.est_)))
|
87 |
+
readme+= "\n\nThis model is trained with dabl library as a baseline, for better results, use [AutoTrain](https://huggingface.co/autotrain).\n\n"
|
88 |
with open(f"{tmpdirname}/README.md", "w+") as f:
|
89 |
f.write(readme)
|
90 |
with open(f"{tmpdirname}/clf.pkl", mode="bw") as f:
|
|
|
97 |
|
98 |
with gr.Blocks() as demo:
|
99 |
main_title = gr.Markdown("""# Baseline Trainer πͺπβ¨""")
|
100 |
+
main_desc = gr.Markdown("""This app trains a baseline model for a given dataset and pushes it to your Hugging Face Hub Profile with a model card. For better results, use [AutoTrain](https://huggingface.co/autotrain).""")
|
101 |
|
102 |
|
103 |
with gr.Tabs():
|