Daeyongkwon98 commited on
Commit
54b7145
ยท
verified ยท
1 Parent(s): d14f87e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -30,13 +30,13 @@ default_generation_config = GenerationConfig(
30
 
31
  # ์‘๋‹ต ์ƒ์„ฑ ํ•จ์ˆ˜
32
  def respond(message, history, system_message, max_tokens, temperature, top_p):
33
- # ์ƒ์„ฑ ์„ค์ • ์—…๋ฐ์ดํŠธ
34
  generation_config = GenerationConfig(
35
  temperature=temperature,
36
  top_p=top_p,
37
- max_new_tokens=max_tokens,
38
  **default_generation_config.to_dict() # ๊ธฐ๋ณธ ์„ค์ •๊ณผ ๋ณ‘ํ•ฉ
39
  )
 
40
 
41
  # ๋Œ€ํ™” ํžˆ์Šคํ† ๋ฆฌ์™€ ์‹œ์Šคํ…œ ๋ฉ”์‹œ์ง€๋ฅผ ํฌํ•จํ•œ ํ”„๋กฌํ”„ํŠธ ๊ตฌ์„ฑ
42
  prompt = prompt_template.safe_substitute({"inst": system_message})
@@ -58,6 +58,7 @@ def respond(message, history, system_message, max_tokens, temperature, top_p):
58
  response += token
59
  yield response
60
 
 
61
  # Gradio Chat Interface ์„ค์ •
62
  demo = gr.ChatInterface(
63
  respond,
 
30
 
31
  # ์‘๋‹ต ์ƒ์„ฑ ํ•จ์ˆ˜
32
  def respond(message, history, system_message, max_tokens, temperature, top_p):
33
+ # ์ƒ์„ฑ ์„ค์ •
34
  generation_config = GenerationConfig(
35
  temperature=temperature,
36
  top_p=top_p,
 
37
  **default_generation_config.to_dict() # ๊ธฐ๋ณธ ์„ค์ •๊ณผ ๋ณ‘ํ•ฉ
38
  )
39
+ generation_config.max_new_tokens = max_tokens # max_tokens๋งŒ ๋”ฐ๋กœ ์„ค์ •
40
 
41
  # ๋Œ€ํ™” ํžˆ์Šคํ† ๋ฆฌ์™€ ์‹œ์Šคํ…œ ๋ฉ”์‹œ์ง€๋ฅผ ํฌํ•จํ•œ ํ”„๋กฌํ”„ํŠธ ๊ตฌ์„ฑ
42
  prompt = prompt_template.safe_substitute({"inst": system_message})
 
58
  response += token
59
  yield response
60
 
61
+
62
  # Gradio Chat Interface ์„ค์ •
63
  demo = gr.ChatInterface(
64
  respond,