yaron123 commited on
Commit
facb8e1
·
1 Parent(s): 459972b
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -545,7 +545,7 @@ def upscaler(
545
  tile_size=(tile_height, tile_width),
546
  denoise_strength=denoise_strength,
547
  num_inference_steps=num_inference_steps,
548
- loras_scale={"more_details": 0.5, "sdxl_render": 1.0},
549
  solver_type=solver_type,
550
  )
551
 
@@ -554,14 +554,13 @@ def upscaler(
554
  return enhanced_image
555
 
556
  def summarize_text(
557
- text, max_length=20, num_beams=64, early_stopping=True
558
  ):
559
  log(f'CALL summarize_text')
560
  summary = pegasus_tokenizer.decode( pegasus_model.generate(
561
  pegasus_tokenizer(text,return_tensors="pt").input_ids,
562
  max_length=max_length,
563
- num_beams=num_beams,
564
- early_stopping=early_stopping
565
  )[0], skip_special_tokens=True)
566
  log(f'RET summarize_text with summary as {summary}')
567
  return summary
@@ -620,7 +619,7 @@ def all_pipes(pos,neg,artist,song):
620
  for img in imgs:
621
  labeled_img = add_song_cover_text(img,artist,song)
622
  enhanced_img = upscaler(labeled_img)
623
- name = f'{pos_artist} - {pos_song} ({index}).png'
624
  enhanced_img.save(name)
625
  names.append(name)
626
  return names
 
545
  tile_size=(tile_height, tile_width),
546
  denoise_strength=denoise_strength,
547
  num_inference_steps=num_inference_steps,
548
+ loras_scale={"more_details": 1.0, "sdxl_render": 1.0},
549
  solver_type=solver_type,
550
  )
551
 
 
554
  return enhanced_image
555
 
556
  def summarize_text(
557
+ text, max_length=10
558
  ):
559
  log(f'CALL summarize_text')
560
  summary = pegasus_tokenizer.decode( pegasus_model.generate(
561
  pegasus_tokenizer(text,return_tensors="pt").input_ids,
562
  max_length=max_length,
563
+ early_stopping=True
 
564
  )[0], skip_special_tokens=True)
565
  log(f'RET summarize_text with summary as {summary}')
566
  return summary
 
619
  for img in imgs:
620
  labeled_img = add_song_cover_text(img,artist,song)
621
  enhanced_img = upscaler(labeled_img)
622
+ name = f'{artist} - {song} ({index}).png'
623
  enhanced_img.save(name)
624
  names.append(name)
625
  return names