Text-to-Image
Diffusers
Safetensors
StableDiffusionPipeline
stable-diffusion
stable-diffusion-diffusers
textual_inversion
diffusers-training
Instructions to use aiwithi/Story_Generation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use aiwithi/Story_Generation with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.bfloat16, device_map="cuda") pipe.load_textual_inversion("aiwithi/Story_Generation") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Download diffusers/tests/lora/test_deprecated_utilities.py from aiwithi/Story_Generation: direct link, hf CLI and curl.
- Browser
- Download file 1.53 kB
-
https://huggingface.co/aiwithi/Story_Generation/resolve/main/diffusers/tests/lora/test_deprecated_utilities.py
- Command line
-
hf download hf://aiwithi/Story_Generation/diffusers/tests/lora/test_deprecated_utilities.py
-
curl -L -o test_deprecated_utilities.py https://huggingface.co/aiwithi/Story_Generation/resolve/main/diffusers/tests/lora/test_deprecated_utilities.py
1.53 kB
| import os | |
| import tempfile | |
| import unittest | |
| import torch | |
| from diffusers.loaders.lora_base import LoraBaseMixin | |
| class UtilityMethodDeprecationTests(unittest.TestCase): | |
| def test_fetch_state_dict_cls_method_raises_warning(self): | |
| state_dict = torch.nn.Linear(3, 3).state_dict() | |
| with self.assertWarns(FutureWarning) as warning: | |
| _ = LoraBaseMixin._fetch_state_dict( | |
| state_dict, | |
| weight_name=None, | |
| use_safetensors=False, | |
| local_files_only=True, | |
| cache_dir=None, | |
| force_download=False, | |
| proxies=None, | |
| token=None, | |
| revision=None, | |
| subfolder=None, | |
| user_agent=None, | |
| allow_pickle=None, | |
| ) | |
| warning_message = str(warning.warnings[0].message) | |
| assert "Using the `_fetch_state_dict()` method from" in warning_message | |
| def test_best_guess_weight_name_cls_method_raises_warning(self): | |
| with tempfile.TemporaryDirectory() as tmpdir: | |
| state_dict = torch.nn.Linear(3, 3).state_dict() | |
| torch.save(state_dict, os.path.join(tmpdir, "pytorch_lora_weights.bin")) | |
| with self.assertWarns(FutureWarning) as warning: | |
| _ = LoraBaseMixin._best_guess_weight_name(pretrained_model_name_or_path_or_dict=tmpdir) | |
| warning_message = str(warning.warnings[0].message) | |
| assert "Using the `_best_guess_weight_name()` method from" in warning_message | |