This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
# model and lora migration from donor server to reciever server | |
MODEL_DIR = Path("./dreambooth_models") | |
TARGET_DIR = Path("./dreambooth_models") | |
@app.get("/get_model/{filename}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! pip install transformers diffusers peft bitsandbytes sentencepiece accelerate protobuf torch | |
import bitsandbytes as bnb | |
from transformers.quantizers.quantizers_utils import get_module_from_name | |
import torch.nn as nn | |
from diffusers import AutoPipelineForText2Image | |
import torch | |
from accelerate.utils import set_module_tensor_to_device, compute_module_sizes |