ldhldh commited on
Commit
0ab0bec
Β·
1 Parent(s): ea3158a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -30,10 +30,11 @@ def get_types(cls_set: List[Type], component: str):
30
  routes.get_types = get_types
31
 
32
  def cut(prom, out):
33
- output = out[len(prom)-2:]
34
  output = output.split('<|endoftext|>')[0]
35
  output = output.split('\n')[0]
36
  output = re.sub('[=+#/\:@*\"β€»γ†γ€β€˜|\\\<\>\(\)\[\]`\'…》\”\β€œ\’·]', ' ', output)
 
37
  return output
38
  # App code
39
  def mbti(x):
@@ -48,12 +49,13 @@ def mbti(x):
48
  return r
49
 
50
  def chat(x):
 
51
  result = gradio_client.predict(
52
  x,# str representing input in 'User input' Textbox component
53
  0.91, # float, representing input in 'Top-p (nucleus sampling)' Slider component
54
  50, # int, representing input in 'Top-k (nucleus sampling)' Slider component
55
  0.8, # float, representing input in 'Temperature' Slider component
56
- 22, # int, representing input in 'Max New Tokens' Slider component
57
  1.1, # float, representing input in 'repetition_penalty' Slider component
58
  fn_index=0
59
  )
 
30
  routes.get_types = get_types
31
 
32
  def cut(prom, out):
33
+ output = out[len(prom)-1:]
34
  output = output.split('<|endoftext|>')[0]
35
  output = output.split('\n')[0]
36
  output = re.sub('[=+#/\:@*\"β€»γ†γ€β€˜|\\\<\>\(\)\[\]`\'…》\”\β€œ\’·]', ' ', output)
37
+ outout = output.replace("ν•˜ν•˜", "γ…Žγ…Ž")
38
  return output
39
  # App code
40
  def mbti(x):
 
49
  return r
50
 
51
  def chat(x):
52
+ x = f"[λ„ˆλŠ” μ§ˆλ¬Έν•˜κΈ°λ₯Ό μ’‹μ•„ν•΄. λ„ˆλŠ” 긍정적이고 곡감을 μž˜ν•˜λŠ” 성격이야. μ§€κΈˆ λ„ˆλŠ” μΉœκ΅¬μ™€ λŒ€ν™”ν•˜κ³  μžˆμ–΄. λ‹¨κ³„λ³„λ‘œ μƒκ°ν•΄μ„œ μžμ—°μŠ€λŸ½κ²Œ λŒ€λ‹΅ν•΄μ€˜.] {x}"
53
  result = gradio_client.predict(
54
  x,# str representing input in 'User input' Textbox component
55
  0.91, # float, representing input in 'Top-p (nucleus sampling)' Slider component
56
  50, # int, representing input in 'Top-k (nucleus sampling)' Slider component
57
  0.8, # float, representing input in 'Temperature' Slider component
58
+ 25, # int, representing input in 'Max New Tokens' Slider component
59
  1.1, # float, representing input in 'repetition_penalty' Slider component
60
  fn_index=0
61
  )