Yebin46 commited on
Commit
73e0bbe
·
verified ·
1 Parent(s): 80b223c

increase # of MAX_TOKEN & remove the sample reasoning/answer box

Browse files
Files changed (1) hide show
  1. app.py +19 -15
app.py CHANGED
@@ -9,14 +9,18 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStream
9
 
10
  os.environ.setdefault("TOKENIZERS_PARALLELISM", "false")
11
 
 
 
 
 
12
  MODEL_ID = os.getenv("MODEL_ID", "Qwen/Qwen3-0.6B")
13
- MAX_NEW_TOKENS = int(os.getenv("MAX_NEW_TOKENS", "256"))
14
  MAX_INPUT_TOKENS = int(os.getenv("MAX_INPUT_TOKENS", "1536"))
15
  MAX_HISTORY_TURNS = int(os.getenv("MAX_HISTORY_TURNS", "3"))
16
  N_THREADS = int(os.getenv("N_THREADS", str(max(1, os.cpu_count() or 1))))
17
  DEFAULT_SYSTEM_PROMPT = os.getenv(
18
  "SYSTEM_PROMPT",
19
- "You are a helpful assistant. Keep answers clear and concise.",
20
  )
21
 
22
  PRESETS = {
@@ -295,19 +299,19 @@ with gr.Blocks(title="Local CPU split-reasoning chat") as demo:
295
  lines=4,
296
  )
297
 
298
- with gr.Row():
299
- sample_reasoning = gr.Textbox(
300
- label="Sample reasoning",
301
- value=PRESETS["Math"]["sample_reasoning"],
302
- lines=5,
303
- interactive=False,
304
- )
305
- sample_answer = gr.Textbox(
306
- label="Sample answer",
307
- value=PRESETS["Math"]["sample_answer"],
308
- lines=5,
309
- interactive=False,
310
- )
311
 
312
  with gr.Row():
313
  send_btn = gr.Button("Send", variant="primary")
 
9
 
10
  os.environ.setdefault("TOKENIZERS_PARALLELISM", "false")
11
 
12
+ # 두 가지 수정을 해야 함
13
+ # 1. Sample reasoning과 Sample answer box 지우기
14
+ # 2. MAX_TOKEN 늘려서 끝까지 생성하고 reasoning과 assistant가 모두 생성된 스크린샷 찍기
15
+ # 3. (Optional) system prompt / your message도 수정해서 새로운 prompt-message 조합으로 실행
16
  MODEL_ID = os.getenv("MODEL_ID", "Qwen/Qwen3-0.6B")
17
+ MAX_NEW_TOKENS = int(os.getenv("MAX_NEW_TOKENS", "2048")) # 256
18
  MAX_INPUT_TOKENS = int(os.getenv("MAX_INPUT_TOKENS", "1536"))
19
  MAX_HISTORY_TURNS = int(os.getenv("MAX_HISTORY_TURNS", "3"))
20
  N_THREADS = int(os.getenv("N_THREADS", str(max(1, os.cpu_count() or 1))))
21
  DEFAULT_SYSTEM_PROMPT = os.getenv(
22
  "SYSTEM_PROMPT",
23
+ "You are a helpful assistant. Keep answers clear and concise. If user",
24
  )
25
 
26
  PRESETS = {
 
299
  lines=4,
300
  )
301
 
302
+ # with gr.Row():
303
+ # sample_reasoning = gr.Textbox(
304
+ # label="Sample reasoning",
305
+ # value=PRESETS["Math"]["sample_reasoning"],
306
+ # lines=5,
307
+ # interactive=False,
308
+ # )
309
+ # sample_answer = gr.Textbox(
310
+ # label="Sample answer",
311
+ # value=PRESETS["Math"]["sample_answer"],
312
+ # lines=5,
313
+ # interactive=False,
314
+ # )
315
 
316
  with gr.Row():
317
  send_btn = gr.Button("Send", variant="primary")