LTT commited on
Commit
8e2925c
·
verified ·
1 Parent(s): 7db39ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -4,7 +4,8 @@ import subprocess
4
  import shlex
5
  import spaces
6
  import torch
7
- import numpy as np
 
8
  subprocess.run(
9
  shlex.split(
10
  "pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cu121_pyt210/download.html"
@@ -93,7 +94,7 @@ isomer_color_weights = torch.from_numpy(np.array([1, 0.5, 1, 0.5])).float().to(d
93
 
94
  # model initialization and loading
95
  # flux
96
- flux_pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to(device=device, dtype=torch.bfloat16)
97
  flux_lora_ckpt_path = hf_hub_download(repo_id="LTT/xxx-ckpt", filename="rgb_normal_large.safetensors", repo_type="model")
98
  flux_pipe.load_lora_weights(flux_lora_ckpt_path)
99
 
 
4
  import shlex
5
  import spaces
6
  import torch
7
+ import numpy as
8
+ access_token = os.getenv("HUGGINGFACE_TOKEN")
9
  subprocess.run(
10
  shlex.split(
11
  "pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cu121_pyt210/download.html"
 
94
 
95
  # model initialization and loading
96
  # flux
97
+ flux_pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16, token=access_token).to(device=device, dtype=torch.bfloat16)
98
  flux_lora_ckpt_path = hf_hub_download(repo_id="LTT/xxx-ckpt", filename="rgb_normal_large.safetensors", repo_type="model")
99
  flux_pipe.load_lora_weights(flux_lora_ckpt_path)
100