Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- convert_url_to_diffusers_multi_gr.py +2 -2
- utils.py +0 -18
convert_url_to_diffusers_multi_gr.py
CHANGED
@@ -225,8 +225,8 @@ def load_and_save_pipeline(pipe, model_type: str, url: str, new_file: str, new_d
|
|
225 |
qkwargs["quantization_config"] = nf4_config
|
226 |
tfqkwargs["quantization_config"] = nf4_config_tf
|
227 |
|
228 |
-
print(f"model_type:{model_type}, dtype:{dtype}, scheduler:{scheduler}, ema:{ema}, base_repo:{base_repo}")
|
229 |
-
print("lora_dict:", lora_dict, "kwargs:", kwargs, "dkwargs:", dkwargs)
|
230 |
|
231 |
#t5 = None
|
232 |
|
|
|
225 |
qkwargs["quantization_config"] = nf4_config
|
226 |
tfqkwargs["quantization_config"] = nf4_config_tf
|
227 |
|
228 |
+
#print(f"model_type:{model_type}, dtype:{dtype}, scheduler:{scheduler}, ema:{ema}, base_repo:{base_repo}")
|
229 |
+
#print("lora_dict:", lora_dict, "kwargs:", kwargs, "dkwargs:", dkwargs)
|
230 |
|
231 |
#t5 = None
|
232 |
|
utils.py
CHANGED
@@ -211,24 +211,6 @@ def upload_repo(repo_id: str, dir_path: str, is_private: bool, is_pr: bool=False
|
|
211 |
return ""
|
212 |
|
213 |
|
214 |
-
def upload_repo_old(repo_id: str, dir_path: str, is_private: bool, is_pr: bool=False, progress=gr.Progress(track_tqdm=True)): # for diffusers repo
|
215 |
-
hf_token = get_token()
|
216 |
-
api = HfApi(token=hf_token)
|
217 |
-
try:
|
218 |
-
progress(0, desc="Start uploading...")
|
219 |
-
api.create_repo(repo_id=repo_id, token=hf_token, private=is_private, exist_ok=True)
|
220 |
-
for path in Path(dir_path).glob("*"):
|
221 |
-
if path.is_dir():
|
222 |
-
api.upload_folder(repo_id=repo_id, folder_path=str(path), path_in_repo=path.name, create_pr=is_pr, token=hf_token)
|
223 |
-
elif path.is_file():
|
224 |
-
api.upload_file(repo_id=repo_id, path_or_fileobj=str(path), path_in_repo=path.name, create_pr=is_pr, token=hf_token)
|
225 |
-
progress(1, desc="Uploaded.")
|
226 |
-
return get_hf_url(repo_id, "model")
|
227 |
-
except Exception as e:
|
228 |
-
print(f"Error: Failed to upload to {repo_id}. {e}")
|
229 |
-
return ""
|
230 |
-
|
231 |
-
|
232 |
HF_SUBFOLDER_NAME = ["None", "user_repo"]
|
233 |
|
234 |
|
|
|
211 |
return ""
|
212 |
|
213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
HF_SUBFOLDER_NAME = ["None", "user_repo"]
|
215 |
|
216 |
|