Skip to content

Commit 23eed39

Browse files
Fix path generation in IP Adapter (#6564)
* Fix path generation on Windows * Update set_default_attn_processors * Use pathlib * Fix quality * Fix copy * Revert changes in set_default_attn_processors --------- Co-authored-by: Sayak Paul <[email protected]>
1 parent fefed44 commit 23eed39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/loaders/ip_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
import os
14+
from pathlib import Path
1515
from typing import Dict, Union
1616

1717
import torch
@@ -138,7 +138,7 @@ def load_ip_adapter(
138138
logger.info(f"loading image_encoder from {pretrained_model_name_or_path_or_dict}")
139139
image_encoder = CLIPVisionModelWithProjection.from_pretrained(
140140
pretrained_model_name_or_path_or_dict,
141-
subfolder=os.path.join(subfolder, "image_encoder"),
141+
subfolder=Path(subfolder, "image_encoder").as_posix(),
142142
).to(self.device, dtype=self.dtype)
143143
self.image_encoder = image_encoder
144144
self.register_to_config(image_encoder=["transformers", "CLIPVisionModelWithProjection"])

0 commit comments

Comments
 (0)