Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -576,8 +576,8 @@ def _summarize(text):
|
|
576 |
toks = tokenizer.encode( prefix + text, return_tensors="pt", truncation=False)
|
577 |
gen = model.generate(
|
578 |
toks,
|
579 |
-
length_penalty=0.
|
580 |
-
num_beams=
|
581 |
early_stopping=True,
|
582 |
max_length=512
|
583 |
)
|
@@ -1286,9 +1286,9 @@ def handle_generation(h,w,d):
|
|
1286 |
d = re.sub(r"([ \t]){1,}", " ", d)
|
1287 |
d = re.sub(r"(\. \.)", ".", d)
|
1288 |
|
1289 |
-
neg = f"Textual, Text, Blurry, Distorted, Exceptional, Irregular, Unusual, Shiny, Smoothed, Polished, Low Quality, Worst Quality, Normal Quality, Anime, Paint, Movies Quality."
|
1290 |
q = "\""
|
1291 |
-
pos = f'
|
1292 |
|
1293 |
print(f"""
|
1294 |
Positive: {pos}
|
|
|
576 |
toks = tokenizer.encode( prefix + text, return_tensors="pt", truncation=False)
|
577 |
gen = model.generate(
|
578 |
toks,
|
579 |
+
length_penalty=0.1,
|
580 |
+
num_beams=32,
|
581 |
early_stopping=True,
|
582 |
max_length=512
|
583 |
)
|
|
|
1286 |
d = re.sub(r"([ \t]){1,}", " ", d)
|
1287 |
d = re.sub(r"(\. \.)", ".", d)
|
1288 |
|
1289 |
+
neg = f"Textual, Text, Unreal, Blurry, Distorted, Exceptional, Irregular, Unusual, Shiny, Smoothed, Polished, Low Quality, Worst Quality, Normal Quality, Anime, Paint, Movies Quality."
|
1290 |
q = "\""
|
1291 |
+
pos = f'Accurate, Detailed, Realistic.{ "" if d == "" else " " + d }'
|
1292 |
|
1293 |
print(f"""
|
1294 |
Positive: {pos}
|