You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe this is from transformer's update,so which version can i use.
Who can help?
No response
Information
The official example scripts
My own modified scripts
Tasks
An officially supported task in the examples folder
My own task or dataset (give details below)
Reproduction
from src import models
from src.utils import IImage, resize
import numpy as np
from src.methods import rasg, sd, sr
from PIL import Image
from peft import get_peft_model, LoraConfig, TaskType
inp_model = models.load_inpainting_model('ds8_inp', device='cpu', cache=True)
lora_config = LoraConfig(
task_type=TaskType.IMAGE_GENERATION,
inference_mode=True,
r=8,
lora_alpha=16,
lora_dropout=0.05,
)
new_model = get_peft_model(inp_model.unet, lora_config)
print(new_model.state_dict().keys())
Expected behavior
/root/miniconda3/lib/python3.10/site-packages/timm/models/layers/init.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
warnings.warn(f"Importing from {name} is deprecated, please import via timm.layers", FutureWarning)
Traceback (most recent call last):
File "/root/autodl-tmp/workspace/HD-Painter/paratest.py", line 6, in
from peft import get_peft_model, LoraConfig, TaskType
File "/root/miniconda3/lib/python3.10/site-packages/peft/init.py", line 22, in
from .auto import (
File "/root/miniconda3/lib/python3.10/site-packages/peft/auto.py", line 32, in
from .mapping import MODEL_TYPE_TO_PEFT_MODEL_MAPPING
File "/root/miniconda3/lib/python3.10/site-packages/peft/mapping.py", line 25, in
from .mixed_model import PeftMixedModel
File "/root/miniconda3/lib/python3.10/site-packages/peft/mixed_model.py", line 29, in
from .peft_model import PeftModel
File "/root/miniconda3/lib/python3.10/site-packages/peft/peft_model.py", line 37, in
from transformers import Cache, DynamicCache, EncoderDecoderCache, PreTrainedModel
ImportError: cannot import name 'Cache' from 'transformers' (/root/miniconda3/lib/python3.10/site-packages/transformers/init.py)
The text was updated successfully, but these errors were encountered:
System Info
transformer==4.39.3;peft==0.14.0
Maybe this is from transformer's update,so which version can i use.
Who can help?
No response
Information
Tasks
examples
folderReproduction
from src import models
from src.utils import IImage, resize
import numpy as np
from src.methods import rasg, sd, sr
from PIL import Image
from peft import get_peft_model, LoraConfig, TaskType
inp_model = models.load_inpainting_model('ds8_inp', device='cpu', cache=True)
lora_config = LoraConfig(
task_type=TaskType.IMAGE_GENERATION,
inference_mode=True,
r=8,
lora_alpha=16,
lora_dropout=0.05,
)
new_model = get_peft_model(inp_model.unet, lora_config)
print(new_model.state_dict().keys())
Expected behavior
/root/miniconda3/lib/python3.10/site-packages/timm/models/layers/init.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
warnings.warn(f"Importing from {name} is deprecated, please import via timm.layers", FutureWarning)
Traceback (most recent call last):
File "/root/autodl-tmp/workspace/HD-Painter/paratest.py", line 6, in
from peft import get_peft_model, LoraConfig, TaskType
File "/root/miniconda3/lib/python3.10/site-packages/peft/init.py", line 22, in
from .auto import (
File "/root/miniconda3/lib/python3.10/site-packages/peft/auto.py", line 32, in
from .mapping import MODEL_TYPE_TO_PEFT_MODEL_MAPPING
File "/root/miniconda3/lib/python3.10/site-packages/peft/mapping.py", line 25, in
from .mixed_model import PeftMixedModel
File "/root/miniconda3/lib/python3.10/site-packages/peft/mixed_model.py", line 29, in
from .peft_model import PeftModel
File "/root/miniconda3/lib/python3.10/site-packages/peft/peft_model.py", line 37, in
from transformers import Cache, DynamicCache, EncoderDecoderCache, PreTrainedModel
ImportError: cannot import name 'Cache' from 'transformers' (/root/miniconda3/lib/python3.10/site-packages/transformers/init.py)
The text was updated successfully, but these errors were encountered: