Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -599,7 +599,7 @@ def _summarize(text):
|
|
599 |
log(f'RET _summarize with ret as {ret}')
|
600 |
return ret
|
601 |
|
602 |
-
def summarize(text, max_words=
|
603 |
log(f'CALL summarize')
|
604 |
|
605 |
words = text.split()
|
@@ -1314,11 +1314,13 @@ def handle_generation(h,w,d):
|
|
1314 |
else:
|
1315 |
d = d if d == "" else translate(d)
|
1316 |
d = re.sub(r"([ \t]){1,}", " ", d)
|
1317 |
-
d = re.sub(r"(\. \.)", ".",
|
|
|
|
|
1318 |
|
1319 |
neg = f"Textual, Text, Blurry, Distorted, Exceptional, Irregular, Unusual, Shiny, Smoothed, Polished, Low Quality, Worst Quality, Normal Quality, Anime Quality, Paint Quality, Movie Quality."
|
1320 |
q = "\""
|
1321 |
-
pos = f'
|
1322 |
|
1323 |
print(f"""
|
1324 |
Positive: {pos}
|
|
|
599 |
log(f'RET _summarize with ret as {ret}')
|
600 |
return ret
|
601 |
|
602 |
+
def summarize(text, max_words=12):
|
603 |
log(f'CALL summarize')
|
604 |
|
605 |
words = text.split()
|
|
|
1314 |
else:
|
1315 |
d = d if d == "" else translate(d)
|
1316 |
d = re.sub(r"([ \t]){1,}", " ", d)
|
1317 |
+
d = re.sub(r"(\. \.)", ".", re.sub(
|
1318 |
+
r"(\. ){1,}", ";", d
|
1319 |
+
)).lower().strip()
|
1320 |
|
1321 |
neg = f"Textual, Text, Blurry, Distorted, Exceptional, Irregular, Unusual, Shiny, Smoothed, Polished, Low Quality, Worst Quality, Normal Quality, Anime Quality, Paint Quality, Movie Quality."
|
1322 |
q = "\""
|
1323 |
+
pos = f'Realistic, Real-Life, Life-Like, Convincing{ "." if d == "" else ". " + d }'
|
1324 |
|
1325 |
print(f"""
|
1326 |
Positive: {pos}
|