verymehari commited on
Commit
105fa40
·
verified ·
1 Parent(s): 5c7bd9a

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. compose/merge.py +4 -2
  2. requirements.txt +1 -1
compose/merge.py CHANGED
@@ -1,5 +1,6 @@
1
  from __future__ import annotations
2
 
 
3
  from pathlib import Path
4
  from typing import Any
5
 
@@ -30,10 +31,11 @@ def _load_pipe():
30
  from diffusers import Flux2KleinPipeline
31
 
32
  device, dtype = _device()
 
33
  pipe = Flux2KleinPipeline.from_pretrained(
34
  BASE_INFERENCE_MODEL,
35
  torch_dtype=dtype,
36
- token=None,
37
  )
38
  pipe = pipe.to(device)
39
  _PIPE = pipe
@@ -45,7 +47,7 @@ def _load_adapters(pipe, lora_ids: list[str], registry_by_id: dict[str, dict[str
45
  if lora_id in _LOADED_ADAPTERS:
46
  continue
47
  repo = registry_by_id[lora_id]["hf_repo"]
48
- pipe.load_lora_weights(repo, adapter_name=lora_id)
49
  _LOADED_ADAPTERS.add(lora_id)
50
 
51
 
 
1
  from __future__ import annotations
2
 
3
+ import os
4
  from pathlib import Path
5
  from typing import Any
6
 
 
31
  from diffusers import Flux2KleinPipeline
32
 
33
  device, dtype = _device()
34
+ token = os.environ.get("HF_TOKEN")
35
  pipe = Flux2KleinPipeline.from_pretrained(
36
  BASE_INFERENCE_MODEL,
37
  torch_dtype=dtype,
38
+ token=token,
39
  )
40
  pipe = pipe.to(device)
41
  _PIPE = pipe
 
47
  if lora_id in _LOADED_ADAPTERS:
48
  continue
49
  repo = registry_by_id[lora_id]["hf_repo"]
50
+ pipe.load_lora_weights(repo, adapter_name=lora_id, token=os.environ.get("HF_TOKEN"))
51
  _LOADED_ADAPTERS.add(lora_id)
52
 
53
 
requirements.txt CHANGED
@@ -3,7 +3,7 @@ pydantic>=2.0
3
  PyYAML>=6.0
4
  Pillow>=10.0
5
  requests>=2.31
6
- huggingface_hub>=0.26
7
  peft>=0.14
8
  accelerate>=1.0
9
  torch
 
3
  PyYAML>=6.0
4
  Pillow>=10.0
5
  requests>=2.31
6
+ huggingface_hub>=0.26,<1.0
7
  peft>=0.14
8
  accelerate>=1.0
9
  torch