Commit
·
78504e4
1
Parent(s):
ec063de
uP
Browse files
upload.py
CHANGED
|
@@ -4,6 +4,7 @@ from huggingface_hub import hf_hub_download
|
|
| 4 |
import huggingface_hub
|
| 5 |
from huggingface_hub import get_repo_discussions
|
| 6 |
from bs4 import BeautifulSoup
|
|
|
|
| 7 |
|
| 8 |
repo_id = "stabilityai/stable-diffusion"
|
| 9 |
repo_id = "huggingface-projects/diffuse-the-rest"
|
|
@@ -27,14 +28,17 @@ for i, disc in enumerate(discussions_list[:10]):
|
|
| 27 |
all_data.append(data)
|
| 28 |
|
| 29 |
dataset_repo_id = "triple-t/dummy"
|
|
|
|
| 30 |
|
| 31 |
file_name = "_".join(repo_id.split("/")) + ".json"
|
| 32 |
api = HfApi()
|
| 33 |
|
| 34 |
-
hf_hub_download(repo_id=dataset_repo_id, filename=file_name, cache_dir="/home/patrick_huggingface_co/image_cache")
|
|
|
|
|
|
|
| 35 |
|
| 36 |
api.upload_file(
|
| 37 |
-
path_or_fileobj=
|
| 38 |
path_in_repo=file_name,
|
| 39 |
repo_id=dataset_repo_id,
|
| 40 |
repo_type="dataset",
|
|
|
|
| 4 |
import huggingface_hub
|
| 5 |
from huggingface_hub import get_repo_discussions
|
| 6 |
from bs4 import BeautifulSoup
|
| 7 |
+
import os
|
| 8 |
|
| 9 |
repo_id = "stabilityai/stable-diffusion"
|
| 10 |
repo_id = "huggingface-projects/diffuse-the-rest"
|
|
|
|
| 28 |
all_data.append(data)
|
| 29 |
|
| 30 |
dataset_repo_id = "triple-t/dummy"
|
| 31 |
+
repo_id = "huggingface-projects/diffuse-the-rest"
|
| 32 |
|
| 33 |
file_name = "_".join(repo_id.split("/")) + ".json"
|
| 34 |
api = HfApi()
|
| 35 |
|
| 36 |
+
path = hf_hub_download(repo_id=dataset_repo_id, filename=file_name, cache_dir="/home/patrick_huggingface_co/image_cache", repo_type="dataset")
|
| 37 |
+
|
| 38 |
+
|
| 39 |
|
| 40 |
api.upload_file(
|
| 41 |
+
path_or_fileobj=path,
|
| 42 |
path_in_repo=file_name,
|
| 43 |
repo_id=dataset_repo_id,
|
| 44 |
repo_type="dataset",
|