Spaces:
Running
Running
Use PR title, minor changes to description.
Browse files- convert.py +2 -2
convert.py
CHANGED
@@ -17,7 +17,7 @@ from diffusers.pipelines.stable_diffusion.convert_from_ckpt import (
|
|
17 |
from transformers import CONFIG_MAPPING
|
18 |
|
19 |
|
20 |
-
COMMIT_MESSAGE = " This PR adds
|
21 |
|
22 |
|
23 |
def convert_single(model_id: str, filename: str, model_type: str, sample_size: int, scheduler_type: str, extract_ema: bool, folder: str):
|
@@ -79,7 +79,7 @@ def convert(token: str, model_id: str, filename: str, model_type: str, sample_si
|
|
79 |
new_pr = None
|
80 |
try:
|
81 |
folder = convert_single(model_id, filename, model_type, sample_size, scheduler_type, extract_ema, folder)
|
82 |
-
new_pr = api.upload_folder(folder_path=folder, path_in_repo="./", repo_id=model_id, repo_type="model", token=token, commit_description=COMMIT_MESSAGE.format(model_id), create_pr=True)
|
83 |
pr_number = new_pr.split("%2F")[-1].split("/")[0]
|
84 |
link = f"Pr created at: {'https://huggingface.co/' + os.path.join(model_id, 'discussions', pr_number)}"
|
85 |
except Exception as e:
|
|
|
17 |
from transformers import CONFIG_MAPPING
|
18 |
|
19 |
|
20 |
+
COMMIT_MESSAGE = " This PR adds fp32 and fp16 weights in PyTorch and safetensors format to {}"
|
21 |
|
22 |
|
23 |
def convert_single(model_id: str, filename: str, model_type: str, sample_size: int, scheduler_type: str, extract_ema: bool, folder: str):
|
|
|
79 |
new_pr = None
|
80 |
try:
|
81 |
folder = convert_single(model_id, filename, model_type, sample_size, scheduler_type, extract_ema, folder)
|
82 |
+
new_pr = api.upload_folder(folder_path=folder, path_in_repo="./", repo_id=model_id, repo_type="model", token=token, commit_message=pr_title, commit_description=COMMIT_MESSAGE.format(model_id), create_pr=True)
|
83 |
pr_number = new_pr.split("%2F")[-1].split("/")[0]
|
84 |
link = f"Pr created at: {'https://huggingface.co/' + os.path.join(model_id, 'discussions', pr_number)}"
|
85 |
except Exception as e:
|