merve HF staff commited on
Commit
42595ef
β€’
1 Parent(s): 1ac7123

fixed parsing

Browse files
Files changed (1) hide show
  1. app.py +2 -12
app.py CHANGED
@@ -7,8 +7,7 @@ import subprocess
7
  import os
8
  import tempfile
9
 
10
- description = "This Space will profile a dataset file that you drag and drop and push the profile report to your Hugging Face account. 🌟
11
- The value in dataset name field you'll enter will be used in the namespace of the Space that will be pushed to your profile, so you can use it to version the reports too! πŸ™ŒπŸ» Feel free to open a discussion in case you have any feature requests. Dataset name you'll enter will be used for repository name so make sure it doesn't exist and it doesn't contain spaces."
12
  title = "Dataset Profiler πŸͺ„βœ¨"
13
  token = gr.Textbox(label = "Your Hugging Face Token")
14
  username = gr.Textbox(label = "Your Hugging Face User Name")
@@ -26,16 +25,7 @@ def profile_dataset(dataset, username, token, dataset_name):
26
 
27
  profile.to_file("./index.html")
28
  upload_file(path_or_fileobj ="./index.html", path_in_repo = "index.html", repo_id =f"{username}/{dataset_name}", repo_type = "space", token=token)
29
- readme = f"---
30
- title: {dataset_name}
31
- emoji: ✨
32
- colorFrom: green
33
- colorTo: red
34
- sdk: static
35
- pinned: false
36
- tags:
37
- - dataset-report
38
- ---"
39
  with open("README.md", "w+") as f:
40
  f.write(readme)
41
  upload_file(path_or_fileobj ="./README.md", path_in_repo = "README.md", repo_id =f"{username}/{dataset_name}", repo_type = "space", token=token)
 
7
  import os
8
  import tempfile
9
 
10
+ description = "This Space will profile a dataset file that you drag and drop and push the profile report to your Hugging Face account. 🌟 The value in dataset name field you'll enter will be used in the namespace of the Space that will be pushed to your profile, so you can use it to version the reports too! πŸ™ŒπŸ» Feel free to open a discussion in case you have any feature requests. Dataset name you'll enter will be used for repository name so make sure it doesn't exist and it doesn't contain spaces."
 
11
  title = "Dataset Profiler πŸͺ„βœ¨"
12
  token = gr.Textbox(label = "Your Hugging Face Token")
13
  username = gr.Textbox(label = "Your Hugging Face User Name")
 
25
 
26
  profile.to_file("./index.html")
27
  upload_file(path_or_fileobj ="./index.html", path_in_repo = "index.html", repo_id =f"{username}/{dataset_name}", repo_type = "space", token=token)
28
+ readme = f"---\ntitle: {dataset_name}\nemoji: ✨\ncolorFrom: green\ncolorTo: red\nsdk: static\npinned: false\ntags:\n- dataset-report\n---"
 
 
 
 
 
 
 
 
 
29
  with open("README.md", "w+") as f:
30
  f.write(readme)
31
  upload_file(path_or_fileobj ="./README.md", path_in_repo = "README.md", repo_id =f"{username}/{dataset_name}", repo_type = "space", token=token)