bkhmsi commited on
Commit
507b3a4
1 Parent(s): f265950

removed unnecessary package

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -9,9 +9,8 @@ import numpy.random as npr
9
  import sys
10
  import imageio
11
  import numpy as np
12
- from glob import glob
13
 
14
- # sys.path.append('./code')
15
 
16
  sys.path.append('/home/user/app/code')
17
 
@@ -29,7 +28,6 @@ os.chdir('/home/user/app')
29
  import torch
30
  from diffusers import StableDiffusionPipeline
31
 
32
-
33
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
34
 
35
  model = None
@@ -103,7 +101,7 @@ def set_config(semantic_concept, word, script, prompt_suffix, font_name, num_ste
103
 
104
  script_path = f"code/data/fonts/{cfg.script}"
105
  if cfg.font == "none":
106
- cfg.font = osp.basename(glob(f"{script_path}/*.ttf")[0])[:-4]
107
 
108
  if is_seed_rand == "Random Seed":
109
  cfg.seed = np.random.randint(10000)
 
9
  import sys
10
  import imageio
11
  import numpy as np
 
12
 
13
+ sys.path.append('./code')
14
 
15
  sys.path.append('/home/user/app/code')
16
 
 
28
  import torch
29
  from diffusers import StableDiffusionPipeline
30
 
 
31
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
32
 
33
  model = None
 
101
 
102
  script_path = f"code/data/fonts/{cfg.script}"
103
  if cfg.font == "none":
104
+ cfg.font = [x for x in os.listdir(script_path) if "ttf" in x][0][:-4]
105
 
106
  if is_seed_rand == "Random Seed":
107
  cfg.seed = np.random.randint(10000)