RohitGandikota commited on
Commit
ccd7636
·
1 Parent(s): 42b98a9

fixing training code

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -18,8 +18,7 @@ model_map = {
18
  'Smiling' : 'models/smiling.pt',
19
  'Professional': 'models/professional.pt',
20
 
21
- 'Wavy Eyebrows': 'models/eyebrows.pt',
22
- 'Small Eyes': 'models/eyesize.pt',
23
 
24
  'Long Hair' : 'models/longhair.pt',
25
  'Curly Hair' : 'models/curlyhair.pt',
@@ -30,6 +29,8 @@ model_map = {
30
  'Repair Images': 'models/repair_slider.pt',
31
  'Fix Hands': 'models/fix_hands.pt',
32
 
 
 
33
  }
34
 
35
  ORIGINAL_SPACE_ID = 'baulab/ConceptSliders'
@@ -189,7 +190,7 @@ class Demo:
189
  value=1000,
190
  precision=0,
191
  label="Iterations",
192
- info='iterations used to train'
193
  )
194
 
195
  self.lr_input = gr.Number(
@@ -234,7 +235,7 @@ class Demo:
234
  )
235
 
236
  def train(self, target_concept,positive_prompt, negative_prompt, rank, iterations_input, lr_input, attributes_input, is_person, pbar = gr.Progress(track_tqdm=True)):
237
-
238
  if attributes_input == '':
239
  attributes_input = None
240
  print(target_concept, positive_prompt, negative_prompt, attributes_input, is_person)
 
18
  'Smiling' : 'models/smiling.pt',
19
  'Professional': 'models/professional.pt',
20
 
21
+
 
22
 
23
  'Long Hair' : 'models/longhair.pt',
24
  'Curly Hair' : 'models/curlyhair.pt',
 
29
  'Repair Images': 'models/repair_slider.pt',
30
  'Fix Hands': 'models/fix_hands.pt',
31
 
32
+ 'Wavy Eyebrows': 'models/eyebrows.pt',
33
+ 'Small Eyes (use scales -3, -1, 1, 3)': 'models/eyesize.pt',
34
  }
35
 
36
  ORIGINAL_SPACE_ID = 'baulab/ConceptSliders'
 
190
  value=1000,
191
  precision=0,
192
  label="Iterations",
193
+ info='iterations used to train - maximum of 1000'
194
  )
195
 
196
  self.lr_input = gr.Number(
 
235
  )
236
 
237
  def train(self, target_concept,positive_prompt, negative_prompt, rank, iterations_input, lr_input, attributes_input, is_person, pbar = gr.Progress(track_tqdm=True)):
238
+ iterations_input = max(int(iterations_input),1000)
239
  if attributes_input == '':
240
  attributes_input = None
241
  print(target_concept, positive_prompt, negative_prompt, attributes_input, is_person)