Yaron Koresh commited on
Commit
43403d6
·
verified ·
1 Parent(s): dce2314

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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=20):
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"(\. \.)", ".", d).lower().strip()
 
 
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'Masterpiece, Best Quality, Hyper-Realistic, Super-Realistic, Natural, Reasonable, Logical{ "." if d == "" else ". " + d }'
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}