Spaces:
Raven7
/
Runtime error

Raven7 commited on
Commit
a5550ee
Β·
verified Β·
1 Parent(s): 8bbe4be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -18
app.py CHANGED
@@ -87,37 +87,35 @@ def respond(
87
  except json.JSecoderror:
88
  response = f"JS λ””μ½”λ”© 였λ₯˜. μ›μ‹œ 응닡: {rawresponse}"
89
 
90
- except Exception as e:
91
- print(f"rror during API request: {e}")
92
  response = f"μ£„μ†‘ν•©λ‹ˆλ‹€. 응닡 생성 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: {str(e)}"
93
 
94
- yield response
95
-
96
  demo = gr.ChatInterface(
97
  respond,
98
- title="My Chatbot",
99
- description= "this is my chatbot!",
100
- additionalinputs=[
101
- gr.extbox(value="""
102
- 당신은 μ±—λ΄‡μž…λ‹ˆλ‹€. λͺ¨λ“  μ§ˆλ¬Έμ— λŒ€ν•΄ μΉœμ ˆν•˜κ³  μ •ν™•ν•œ 닡변을 μ œκ³΅ν•˜μ„Έμš”.
103
- μ§ˆλ¬Έμ— λŒ€ν•œ 닡변을 찾을 수 μ—†λŠ” 경우, μ μ ˆν•œ λŒ€μ•ˆμ„ μ œκ³΅ν•΄ μ£Όμ„Έμš”.
104
  """, label="μ‹œμŠ€ν…œ ν”„λ‘¬ν”„νŠΈ"),
105
- gr.Slider(minimum=1, maximum=4000, value=2000, step=1, label="Max new tokens"),
106
- gr.Slider(minimum=0.1, maximum=4.0, value=1.0, step=0.1, label="temperature"),
107
  gr.Slider(
108
  minimum=0.1,
109
  maximum=1.0,
110
  value=0.95,
111
  step=0.05,
112
- label="top-p (nucleus sampling)",
113
  ),
114
  ],
115
- examples=[
116
- ["ν•œκΈ€λ‘œ 닡변할것"],
117
- ["계속 μ΄μ–΄μ„œ μž‘μ„±ν•˜λΌ"],
118
  ],
119
- cacheexamples=alse,
120
  )
121
 
122
- if name == "main":
123
  demo.launch()
 
87
  except json.JSecoderror:
88
  response = f"JS λ””μ½”λ”© 였λ₯˜. μ›μ‹œ 응닡: {rawresponse}"
89
 
90
+ except Exception as e:
91
+ print(f"였λ₯˜: 응닡 생성 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: {str(e)}")
92
  response = f"μ£„μ†‘ν•©λ‹ˆλ‹€. 응닡 생성 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: {str(e)}"
93
 
 
 
94
  demo = gr.ChatInterface(
95
  respond,
96
+ title="My Chatbot",
97
+ description="This is my chatbot!",
98
+ additional_inputs=[
99
+ gr.Textbox(value="""
100
+ 당신은 μ±—λ΄‡μž…λ‹ˆλ‹€. λͺ¨λ“  μ§ˆλ¬Έμ— λŒ€ν•΄ μΉœμ ˆν•˜κ³  μ •ν™•ν•œ 닡변을 μ œκ³΅ν•˜μ„Έμš”.
101
+ μ§ˆλ¬Έμ— λŒ€ν•œ 닡변을 찾을 수 μ—†λŠ” 경우, μ μ ˆν•œ λŒ€μ•ˆμ„ μ œκ³΅ν•΄ μ£Όμ„Έμš”.
102
  """, label="μ‹œμŠ€ν…œ ν”„λ‘¬ν”„νŠΈ"),
103
+ gr.Slider(minimum=1, maximum=4000, value=2000, step=1, label="μ΅œλŒ€ 토큰 수"),
104
+ gr.Slider(minimum=0.1, maximum=4.0, value=1.0, step=0.1, label="μ˜¨λ„"),
105
  gr.Slider(
106
  minimum=0.1,
107
  maximum=1.0,
108
  value=0.95,
109
  step=0.05,
110
+ label="top-p (핡심 μƒ˜ν”Œλ§)",
111
  ),
112
  ],
113
+ examples=[
114
+ ["μ•ˆλ…•"],
115
+ ["계속 μ΄μ–΄μ„œ μž‘μ„±ν•΄λ΄"],
116
  ],
117
+ cache_examples=False,
118
  )
119
 
120
+ if __name__ == "__main__":
121
  demo.launch()