Views
No views yet
⚠️ 規格重點: 本模型為 純文本單模態(Single Modality)版本。
T1,是 Taiwan 的諧音縮寫,代表我們對於台灣本土文化的尊重與熱愛。
| 模型 | 評測模式 | TMMLU+(%) | 台灣法律(%) | MMLU(%) | 測試次數 | 選項排序 |
|---|---|---|---|---|---|---|
| google/gemma-3-4b-it | box | 35.12 (±0.018) | 32.69 (±0.021) | 41.03 (±0.019) | 3 | 隨機 |
| 🌟twinkle-ai/Llama-3.2-3B-F1-Instruct (ours) | box | 44.11 (±0.018) | 35.24 (±0.012) | 50.64 (±0.019) | 3 | 隨機 |
| 🌟twinkle-ai/gemma-3-4B-T1-it (ours) | box | 47.44 (±0.018) | 44.18 (±0.022) | 59.13 (±0.021) | 3 | 隨機 |
| Model | Overall Accuracy | AST Accuracy (S.) | AST Accuracy (M.) | AST Accuracy (P.) | AST Accuracy (P.M.) |
|---|---|---|---|---|---|
| google/gemma-3-4b-it | 61 | 64 | 88 | 56 | 36 |
| 🌟twinkle-ai/Llama-3.2-3B-F1-Instruct (ours) | 91 | 93 | 95 | 91 | 87 |
| 🌟twinkle-ai/gemma-3-4B-T1-it (ours) | 84.5 | 88 | 89 | 80 | 81 |
註:圖片中 👈 為 gemma-3-4B-it ; 👉 為 🌟gemma-3-4B-T1-it
國外的模型翻譯幾乎都是「中國用語」
1vllm serve twinkle-ai/gemma-3-4B-T1-it \
2 --port 8000 \
3 --enable-auto-tool-choice \
4 --tool-call-parser hermes1def get_weather(location: str, unit: str):
2 return f"{location}的氣溫是{unit}26度,晴朗無風"
3
4def search(query: str):
5 return "川普終於宣布對等關稅政策,針對 18 個經濟體課徵一半的對等關稅,並從 4/5 起對所有進口產品徵收10%的基準關稅!美國將針對被認定為不當貿易行為(不公平貿易) 的國家,於 4/9 起課徵報復型對等關稅 (Discounted Reciprocal Tariff),例如:日本將被課徵 24% 的關稅,歐盟則為 20%,以取代普遍性的 10% 關稅。\n針對中國則開啟新一波 34% 關稅,並疊加於先前已實施的關稅上,這將使中國進口商品的基本關稅稅率達到 54%,而且這尚未包含拜登總統任內或川普第一任期所施加的額外關稅。加拿大與墨西哥則不適用這套對等關稅制度,但川普認為這些國家在芬太尼危機與非法移民問題尚未完全解決,因此計畫對這兩國的大多數進口商品施加 25% 關稅。另外原本針對汽車與多數其他商品的關稅豁免將於 4/2 到期。\n台灣的部分,美國擬向台灣課徵32%的對等關稅,雖然並未針對晶片特別課徵關稅,但仍在記者會中提到台灣搶奪所有的電腦與半導體晶片,最終促成台積電對美國投資計劃額外加碼 1,000 億美元的歷史性投資;歐盟則課徵20%的對等關稅。最後是汽車關稅將於 4/2 起,對所有外國製造的汽車課徵25% 關稅。"
6
7tools = [
8 {
9 "type": "function",
10 "function": {
11 "name": "get_weather",
12 "description": "Get the current weather in a given location",
13 "parameters": {
14 "type": "object",
15 "properties": {
16 "location": {"type": "string", "description": "國家或城市名, e.g., 'Taipei'、'Jaipei'"},
17 "unit": {"type": "string", "description": "氣溫單位,亞洲城市使用攝氏;歐美城市使用華氏", "enum": ["celsius", "fahrenheit"]}
18 },
19 "required": ["location", "unit"]
20 }
21 }
22 },
23 {
24 "type": "function",
25 "function": {
26 "name": "search",
27 "description": "這是一個類似 Google 的搜尋引擎,關於知識、天氣、股票、電影、小說、百科等等問題,如果你不確定答案就搜尋一下。",
28 "parameters": {
29 "type": "object",
30 "properties": {
31 "query": {"type": "string", "description": "should be a search query, e.g., '2024 南韓 戒嚴'"}
32 },
33 "required": ["query"]
34 }
35 }
36 }
37]⚠️ 注意:system_prompt 可以不用帶,除非是需要時間基準的工具。
1response = client.chat.completions.create(
2 model=client.models.list().data[0].id,
3 messages=[
4 {"role": "system", "content": "記住你的知識截止於 2024/12,今天是 2025/4/7"},
5 {"role": "user", "content": "台北氣溫如何? 另外,告訴我川普最新關稅政策"},
6 ],
7 max_tokens=1500,
8 temperature=0.6,
9 top_p=0.95,
10 tools=tools,
11 tool_choice="auto"
12)
13
14print(response.choices[0].message.tool_calls)[ChatCompletionMessageToolCall(id='chatcmpl-tool-35e74420119349999913a10133b84bd3', function=Function(arguments='{"location": "Taipei", "unit": "celsius"}', name='get_weather'), type='function'), ChatCompletionMessageToolCall(id='chatcmpl-tool-7ffdcb98e59f4134a6171defe7f2e31b', function=Function(arguments='{"query": "Donald Trump latest tariffs policy"}', name='search'), type='function')]1response = client.chat.completions.create(
2 model=client.models.list().data[0].id,
3 messages=[
4 {"role": "system", "content": "記住你的知識截止於 2024/12,今天是 2025/4/7"},
5 {"role": "user", "content": "台北氣溫如何? 另外,告訴我川普最新關稅政策"},
6 {
7 "role": "assistant",
8 "content": "",
9 "tool_calls": [
10 {
11 "id": response.choices[0].message.tool_calls[0].id,
12 "type": "function",
13 "function": {
14 "name": response.choices[0].message.tool_calls[0].function.name,
15 "arguments": response.choices[0].message.tool_calls[0].function.arguments
16 }
17 },
18 {
19 "id": response.choices[0].message.tool_calls[1].id,
20 "type": "function",
21 "function": {
22 "name": response.choices[0].message.tool_calls[1].function.name,
23 "arguments": response.choices[0].message.tool_calls[1].function.arguments
24 }
25 }
26 ]
27 },
28 {
29 "role": "tool",
30 "content": search(**json.loads(response.choices[0].message.tool_calls[0].function.arguments)),
31 "tool_call_id": response.choices[0].message.tool_calls[0].id # tool_call_id 必須要帶,才能正確配對 工具 及 tool_call
32 },
33 {
34 "role": "tool",
35 "content": get_weather(**json.loads(response.choices[0].message.tool_calls[1].function.arguments)),
36 "tool_call_id": response.choices[0].message.tool_calls[1].id # tool_call_id 必須要帶,才能正確配對 工具 及 tool_call
37 }
38 ],
39 max_tokens=1500,
40 temperature=0.6,
41 top_p=0.95,
42 tools=tools,
43 tool_choice="auto"
44)
45
46print(response.choices[0].message.content)1以下是您請求的資訊:
2
3**臺北市氣溫**
4- 目前的氣溫為 **26°C**(攝氏)
5- 天候狀況:晴朗無風
6
7**川普最新關稅政策概述**
81. **對等關稅政策**
9 - 對 18 個經濟體課徵 50% 的對等關稅
10 - 自 4 月 5 日起,所有進口產品全面徵收 10% 基本關稅
11
122. **報復型對等關稅**
13 - 日本 24%、歐盟 20%
14
153. **對中國的高額關稅**
16 - 增加至 54%(原有關稅 + 新增 34%)
17
184. **特殊案例**
19 - 加拿大與墨西哥不適用,但其他商品課徵 25%
20 - 汽車與部分商品的免稅即將到期
21
225. **對台灣的影響**
23 - 美國計畫對台灣課徵 32% 關稅,但晶片暫無額外課稅
24
256. **全球視角**
26 - 歐盟與日本關稅比例相對較高1@misc{twinkleai2025gemma3t1,
2 title = {gemma-3-4B-T1-it: A Traditional Chinese Instruction-Tuned Language Model for Taiwan},
3 author = {Huang, Liang Hsun and Chen, Min Yi and Lin, Wen Bin and Sung, Dave},
4 year = {2025},
5 howpublished = {\url{https://huggingface.co/twinkle-ai/gemma-3-4B-T1-it}},
6 note = {Twinkle AI and APMIC. All authors contributed equally.}
7}