Spaces:
Sleeping
Sleeping
commit
Browse files
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
|
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=
|
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 |
-
|
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'{
|
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
|