kaupane commited on
Commit
1a917cb
·
verified ·
1 Parent(s): 8e9c44c

Update app.py

Browse files

Use huggingface model hub instead to store checkpoints instead of including them directly.

Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -6,6 +6,7 @@ import os
6
  import random
7
  from mapping import reduced_genre_mapping, reduced_style_mapping, reverse_reduced_genre_mapping, reverse_reduced_style_mapping
8
  from diffusers import AutoencoderKL
 
9
  from models.DiT import DiT
10
 
11
  # Global settings
@@ -19,7 +20,11 @@ global_progress = 0
19
 
20
  def load_dit_model(dit_size):
21
  """Load DiT model of specified size"""
22
- ckpt_path = f"./ckpts/DiT_{dit_size}_final.pth"
 
 
 
 
23
  if not os.path.exists(ckpt_path):
24
  raise FileNotFoundError(f"Checkpoint not found at {ckpt_path}")
25
 
 
6
  import random
7
  from mapping import reduced_genre_mapping, reduced_style_mapping, reverse_reduced_genre_mapping, reverse_reduced_style_mapping
8
  from diffusers import AutoencoderKL
9
+ from huggingface_hub import hf_hub_download
10
  from models.DiT import DiT
11
 
12
  # Global settings
 
20
 
21
  def load_dit_model(dit_size):
22
  """Load DiT model of specified size"""
23
+ #ckpt_path = f"./ckpts/DiT_{dit_size}_final.pth"
24
+ ckpt_path = hf_hub_download(
25
+ repo_id = "kaupane/DiT-Wikiart",
26
+ filename = f"DiT_{dit_size}_final.pth"
27
+ )
28
  if not os.path.exists(ckpt_path):
29
  raise FileNotFoundError(f"Checkpoint not found at {ckpt_path}")
30