Yaron Koresh commited on
Commit
10f9e54
·
verified ·
1 Parent(s): 4c3cee5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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.7,
580
- num_beams=16,
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'Real-life { "." if d == "" else " of " + d }'
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}