Update app.py
Browse files14 unmodified lines1516171819201 unmodified line22232425262728293031323314 unmodified linesdataset = gr.File(label = "Dataset")output_text = gr.Textbox(label = "Status")def profile_dataset(dataset, username, token, dataset_name):df = pd.read_csv(dataset.name)1 unmodified linerepo_url = create_repo(f"{username}/{dataset_name}", repo_type = "space", token = token, space_sdk = "static", private=False)profile.to_file("./index.html")upload_file(path_or_fileobj ="./index.html", path_in_repo = "index.html", repo_id =f"{username}/{dataset_name}", repo_type = "space", token=token)return f"Your dataset report will be ready at {repo_url}"gr.Interface(profile_dataset, title = title, description = description, inputs = [dataset, username, token, dataset_name], outputs=[output_text], enable_queue = True).launch(debug=True)14 unmodified lines151617181920211 unmodified line2324252627282930313233343514 unmodified linesdataset = gr.File(label = "Dataset")output_text = gr.Textbox(label = "Status")def profile_dataset(dataset, username, token, dataset_name):df = pd.read_csv(dataset.name)1 unmodified linerepo_url = create_repo(f"{username}/{dataset_name}", repo_type = "space", token = token, space_sdk = "static", private=False)profile.to_file("./index.html")upload_file(path_or_fileobj ="./index.html", path_in_repo = "index.html", repo_id =f"{username}/{dataset_name}", repo_type = "space", token=token)readme = f"---\ntitle: {dataset_name}\nemoji: ✨\ncolorFrom: green\ncolorTo: red\nsdk: static\npinned: false\ntags:\n- dataset-report\n---"with open("README.md", "w+") as f:f.write(readme)upload_file(path_or_fileobj ="./README.md", path_in_repo = "README.md", repo_id =f"{username}/{dataset_name}", repo_type = "space", token=token)return f"Your dataset report will be ready at {repo_url}"gr.Interface(profile_dataset, title = title, description = description, inputs = [dataset, username, token, dataset_name], outputs=[output_text], enable_queue = True).launch(debug=True)
app.py+7-5