miyuki2026 commited on
Commit
1bb71fb
·
1 Parent(s): 642ecdb
Files changed (1) hide show
  1. tabs/chat_template_tab.py +7 -2
tabs/chat_template_tab.py CHANGED
@@ -29,10 +29,10 @@ def get_chat_template_tab():
29
  "jingyaogong/MiniMind2",
30
 
31
  ]
32
- ct_model_name = gr.Dropdown(choices=model_name_choices, value=model_name_choices[0], label="model_name")
33
  ct_conversation = gr.Textbox(label="conversation")
34
  ct_add_generation_prompt = gr.Checkbox(label="add_generation_prompt")
35
- ct_tokenize = gr.Button("tokenize")
36
  ct_output = gr.Textbox(label="output", max_lines=100)
37
 
38
  ct_tokenize.click(
@@ -47,6 +47,11 @@ def get_chat_template_tab():
47
  json.dumps([{"role": "user", "content": "帮我识别出文本中的关键词:\n凉山彝族社会中的\"尔普\"(份子钱)是一种礼物交换形式.对\"尔普\"的研究和分析,可有助于人们理解凉山彝族社会.\"尔普\"本来是维系彝族传统社会宗族内部亲属组织的纽带,由于文化变迁的原因,后来发展出了跨宗族的\"尔普\"新形式,又由于族群互动的原因,还产生了跨越族群的\"尔普\"形式.\"尔普\"形式的变迁是族群互动下的一种文化变迁形式,其动力来源于彝、汉两族的互动关系.彝族社会中\"尔普\"的变迁形式是人类学关于族群互动下的文化变迁理论的鲜活事例."}, {"role": "assistant", "content": "彝族;尔普;礼物交换;族群互动"}], ensure_ascii=False),
48
  "Qwen/Qwen3-8B",
49
  True,
 
 
 
 
 
50
  ]
51
  ],
52
  inputs=[ct_conversation, ct_model_name, ct_add_generation_prompt],
 
29
  "jingyaogong/MiniMind2",
30
 
31
  ]
32
+ ct_model_name = gr.Dropdown(choices=model_name_choices, value=model_name_choices[0], label="model_name", allow_custom_value=True)
33
  ct_conversation = gr.Textbox(label="conversation")
34
  ct_add_generation_prompt = gr.Checkbox(label="add_generation_prompt")
35
+ ct_tokenize = gr.Button("tokenize", variant="primary")
36
  ct_output = gr.Textbox(label="output", max_lines=100)
37
 
38
  ct_tokenize.click(
 
47
  json.dumps([{"role": "user", "content": "帮我识别出文本中的关键词:\n凉山彝族社会中的\"尔普\"(份子钱)是一种礼物交换形式.对\"尔普\"的研究和分析,可有助于人们理解凉山彝族社会.\"尔普\"本来是维系彝族传统社会宗族内部亲属组织的纽带,由于文化变迁的原因,后来发展出了跨宗族的\"尔普\"新形式,又由于族群互动的原因,还产生了跨越族群的\"尔普\"形式.\"尔普\"形式的变迁是族群互动下的一种文化变迁形式,其动力来源于彝、汉两族的互动关系.彝族社会中\"尔普\"的变迁形式是人类学关于族群互动下的文化变迁理论的鲜活事例."}, {"role": "assistant", "content": "彝族;尔普;礼物交换;族群互动"}], ensure_ascii=False),
48
  "Qwen/Qwen3-8B",
49
  True,
50
+ ],
51
+ [
52
+ json.dumps([{"role": "system", "content": "你是一个有帮助的助手,可以调用工具来获取信息。可用工具:[工具描述JSON]"}, {"role": "user", "content": "查询北京和上海的天气对比"}, {"role": "assistant", "content": "用户想比较两地的天气,我需要分别查询。", "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "get_weather", "arguments": "{\"location\": \"北京\"}"}}, {"id": "call_2", "type": "function", "function": {"name": "get_weather", "arguments": "{\"location\": \"上海\"}"}}]}, {"role": "tool", "content": "{\"weather\": \"sunny\", \"temperature\": 22}", "tool_call_id": "call_1"}, {"role": "tool", "content": "{\"weather\": \"cloudy\", \"temperature\": 24}", "tool_call_id": "call_2"}, {"role": "assistant", "content": "北京:晴天,22°C;上海:多云,24°C。两地温差不大,上海稍暖一些。"}]),
53
+ "Qwen/Qwen3-8B",
54
+ True,
55
  ]
56
  ],
57
  inputs=[ct_conversation, ct_model_name, ct_add_generation_prompt],