Compare commits

..

3 Commits

Author SHA1 Message Date
Dhruv Nair 644846aa14 update 2023-12-08 12:28:50 +00:00
Dhruv Nair 6a90d8a023 Merge branch 'main' into compile-test-fix 2023-12-08 11:10:18 +00:00
Dhruv Nair 7270cbf421 update 2023-12-08 09:58:13 +00:00
2 changed files with 8 additions and 6 deletions
@@ -135,8 +135,8 @@ from safetensors.torch import load_file
"""
diffusers_example_pivotal = f"""embedding_path = hf_hub_download(repo_id='{repo_id}', filename="embeddings.safetensors", repo_type="model")
state_dict = load_file(embedding_path)
pipeline.load_textual_inversion(state_dict["clip_l"], token=["<s0>", "<s1>"], text_encoder=pipeline.text_encoder, tokenizer=pipeline.tokenizer)
pipeline.load_textual_inversion(state_dict["clip_g"], token=["<s0>", "<s1>"], text_encoder=pipeline.text_encoder_2, tokenizer=pipeline.tokenizer_2)
pipeline.load_textual_inversion(state_dict["clip_l"], token=["<s0>", "<s1>"], text_encoder=pipe.text_encoder, tokenizer=pipe.tokenizer)
pipeline.load_textual_inversion(state_dict["clip_g"], token=["<s0>", "<s1>"], text_encoder=pipe.text_encoder_2, tokenizer=pipe.tokenizer_2)
"""
if token_abstraction_dict:
for key, value in token_abstraction_dict.items():
@@ -157,8 +157,6 @@ tags:
base_model: {base_model}
instance_prompt: {instance_prompt}
license: openrail++
widget:
- text: '{validation_prompt if validation_prompt else instance_prompt}'
---
"""
+6 -2
View File
@@ -820,7 +820,9 @@ def _is_torch_fp16_available(device):
try:
x = torch.zeros((2, 2), dtype=torch.float16).to(device)
_ = x @ x
_ = torch.mul(x, x)
return True
except Exception as e:
if device.type == "cuda":
raise ValueError(
@@ -838,7 +840,9 @@ def _is_torch_fp64_available(device):
try:
x = torch.zeros((2, 2), dtype=torch.float64).to(device)
_ = x @ x
_ = torch.mul(x, x)
return True
except Exception as e:
if device.type == "cuda":
raise ValueError(