ldhldh commited on
Commit
12ef829
Β·
1 Parent(s): c1f0168

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -29,6 +29,12 @@ def get_types(cls_set: List[Type], component: str):
29
  return docset, types
30
  routes.get_types = get_types
31
 
 
 
 
 
 
 
32
  # App code
33
  def mbti(x):
34
  t = loop.run_until_complete(translator.translate(x, src='ko', dest='en'))
@@ -51,6 +57,8 @@ def chat(x):
51
  1.2, # float, representing input in 'repetition_penalty' Slider component
52
  fn_index=0
53
  )
 
 
54
  return result
55
 
56
  def yn(x):
 
29
  return docset, types
30
  routes.get_types = get_types
31
 
32
+ def cut(prom, out):
33
+ output = out[len(prom):]
34
+ output = output.split('\n')[0]
35
+ output = output.split('<|endoftext|>')[0]
36
+ output = re.sub('[=+#/\:@*\"β€»γ†γ€β€˜|\\\<\>\(\)\[\]`\'…》\”\β€œ\’·]', ' ', output)
37
+ return output
38
  # App code
39
  def mbti(x):
40
  t = loop.run_until_complete(translator.translate(x, src='ko', dest='en'))
 
57
  1.2, # float, representing input in 'repetition_penalty' Slider component
58
  fn_index=0
59
  )
60
+ result = cut(x, result)
61
+
62
  return result
63
 
64
  def yn(x):