Spaces:
Running
Running
Adding unique id to notebook name to follow up how many notebooks will be generated
Browse files
app.py
CHANGED
|
@@ -12,6 +12,7 @@ from utils.notebook_utils import (
|
|
| 12 |
from dotenv import load_dotenv
|
| 13 |
import os
|
| 14 |
from nbconvert import HTMLExporter
|
|
|
|
| 15 |
|
| 16 |
load_dotenv()
|
| 17 |
|
|
@@ -176,7 +177,9 @@ def generate_cells(dataset_id, notebook_title):
|
|
| 176 |
cells, wildcards, replacements, has_numeric_columns, has_categoric_columns
|
| 177 |
)
|
| 178 |
|
| 179 |
-
notebook_name =
|
|
|
|
|
|
|
| 180 |
html_content = create_notebook_file(cells, notebook_name=notebook_name)
|
| 181 |
_push_to_hub(dataset_id, notebook_name)
|
| 182 |
notebook_link = f"https://colab.research.google.com/#fileId=https%3A//huggingface.co/datasets/asoria/dataset-notebook-creator-content/blob/main/{notebook_name}"
|
|
|
|
| 12 |
from dotenv import load_dotenv
|
| 13 |
import os
|
| 14 |
from nbconvert import HTMLExporter
|
| 15 |
+
import uuid
|
| 16 |
|
| 17 |
load_dotenv()
|
| 18 |
|
|
|
|
| 177 |
cells, wildcards, replacements, has_numeric_columns, has_categoric_columns
|
| 178 |
)
|
| 179 |
|
| 180 |
+
notebook_name = (
|
| 181 |
+
f"{dataset_id.replace('/', '-')}-{notebook_type}-{uuid.uuid4()}.ipynb"
|
| 182 |
+
)
|
| 183 |
html_content = create_notebook_file(cells, notebook_name=notebook_name)
|
| 184 |
_push_to_hub(dataset_id, notebook_name)
|
| 185 |
notebook_link = f"https://colab.research.google.com/#fileId=https%3A//huggingface.co/datasets/asoria/dataset-notebook-creator-content/blob/main/{notebook_name}"
|