Tamil Llama 7b Instruct V0.2
這是一個基於LLaMA-2的7B參數泰米爾語指導模型,支持英語和泰米爾雙語處理。
下載量 197
發布時間 : 1/23/2024
模型概述
該模型是推動泰米爾語言大模型發展的重要一步,已準備好進行推理或進一步微調以滿足特定自然語言處理任務需求。
模型特點
雙語支持
同時支持英語和泰米爾語處理
泰米爾語增強
在原始LLaMA-2基礎上增加了約16,000個泰米爾詞彙
指令跟隨
專門針對指令跟隨任務進行了優化
模型能力
泰米爾語文本生成
英語文本生成
指令理解與執行
多輪對話
使用案例
教育
泰米爾文化解釋
解釋泰米爾節日和傳統
示例中成功解釋了Pongal節日的意義
客服
雙語客服助手
為泰米爾語用戶提供英語-泰米爾雙語客服支持
🚀 泰米爾語LLaMA 7B指令模型v0.2
泰米爾語LLaMA 7B指令模型的首次發佈是推進泰米爾語大語言模型發展的重要一步。該模型可立即用於推理,也可進一步微調以滿足您特定的自然語言處理任務需求。
若您想深入瞭解該模型的開發過程和能力,請閱讀研究論文和介紹性博客文章(待完成),其中概述了我們的研究歷程以及該模型的潛在影響。
🚀 快速開始
本模型可立即用於推理,也可進一步微調以滿足您特定的自然語言處理任務需求。您可以通過以下方式深入瞭解模型:
- 閱讀研究論文,瞭解模型的開發過程和能力。
- 查看介紹性博客文章(待完成),瞭解我們的研究歷程以及該模型的潛在影響。
✨ 主要特性
- 雙語支持:支持英語和泰米爾語,適用於雙語自然語言處理任務。
- 可微調:可進一步微調以滿足特定的自然語言處理任務需求。
- 高性能:在多個基準測試中表現出色,如ARC Challenge、TruthfulQA等。
📦 安裝指南
文檔未提供具體安裝步驟,暫不展示。
💻 使用示例
基礎用法
from transformers import LlamaForCausalLM, AutoTokenizer, pipeline
model = LlamaForCausalLM.from_pretrained(
"abhinand/tamil-llama-instruct-v0.2",
#load_in_8bit=True, # Set this depending on the GPU you have
torch_dtype=torch.bfloat16,
device_map={"": 0}, # Set this depending on the number of GPUs you have
local_files_only=False # Optional
)
model.eval()
tokenizer = AutoTokenizer.from_pretrained("abhinand/tamil-llama-instruct-v0.2")
inf_pipeline = pipeline("conversational", model=model, tokenizer=tokenizer)
def format_instruction(system_prompt, question, return_dict=False):
if system_prompt is None:
messages = [
{'content': question, 'role': 'user'},
]
else:
messages = [
{'content': system_prompt, 'role': 'system'},
{'content': question, 'role': 'user'},
]
if return_dict:
return messages
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
return prompt
# Set the generation configuration according to your needs
temperature = 0.6
repetition_penalty = 1.1
max_new_tokens = 256
SYSTEM_PROMPT = "You are an AI assistant who follows instructions extremely well. Do your best your best to help."
INPUT = "Can you explain the significance of Tamil festival Pongal?"
instruction = format_instruction(
system_prompt=SYSTEM_PROMPT,
question=INPUT,
return_dict=True,
)
output = inf_pipeline(
instruction,
temperature=temperature,
max_new_tokens=max_new_tokens,
repetition_penalty=repetition_penalty
)
print(output)
示例輸出
Conversation id: d57cdf33-01ff-4328-8efe-5c4fefdd6e77
system: You are an AI assistant who follows instructions extremely well. Do your best your best to help.
user: Can you explain the significance of Tamil festival Pongal?
assistant: Pongal is a significant harvest festival celebrated in Tamil Nadu and other parts of southern India. It marks the end of the rainy season and beginning of the agricultural year. The festival primarily revolves around giving gratitude to nature, particularly the Sun God Surya for his bountiful gifts like agriculture and health. People offer prayers to cattle, which play a significant role in agriculture, as well as their families for their continued support during the harvest season. The festival is marked by various colorful events, including preparing traditional Pongal dishes like rice cooked with milk, sugarcane, and banana, followed by exchanging gifts and celebrating among family members and friends. It also serves as a time for unity and strengthens the bond between people in their communities.
📚 詳細文檔
模型描述
泰米爾語LLaMA模型在原始LLaMA - 2的基礎上進行了增強和定製,擁有約16,000個標記的廣泛泰米爾語詞彙。
屬性 | 詳情 |
---|---|
模型類型 | 一個70億參數的類GPT模型,在約500,000個樣本上進行微調,這些樣本中英語和泰米爾語樣本比例相等。(數據集即將發佈) |
語言 | 雙語,英語和泰米爾語 |
許可證 | GNU通用公共許可證v3.0 |
微調基礎模型 | 即將發佈 |
訓練精度 | bfloat16 |
代碼 | GitHub(即將更新) |
提示模板:ChatML
<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
基準測試結果
使用LLM - Autoeval在runpod的RTX 3090上進行基準測試。
⚠️ 重要提示
請注意,在Open LLM排行榜分數與使用LM Eval Harness在相同配置下本地運行獲得的分數之間存在差異。此處提到的結果基於我們自己的基準測試。若要復現這些結果,您可以使用LLM - Autoeval或在本地使用lm - evaluation - harness,並按照Open LLM排行榜“關於”頁面中描述的配置進行操作。
基準測試 | Llama 2 Chat | 泰米爾語Llama v0.2指令模型 | 泰盧固語Llama指令模型 | 馬拉雅拉姆語Llama指令模型 |
---|---|---|---|---|
ARC挑戰(25次射擊) | 52.9 | 53.75 | 52.47 | 52.82 |
TruthfulQA(0次射擊) | 45.57 | 47.23 | 48.47 | 47.46 |
Hellaswag(10次射擊) | 78.55 | 76.11 | 76.13 | 76.91 |
Winogrande(5次射擊) | 71.74 | 73.95 | 71.74 | 73.16 |
AGI評估(0次射擊) | 29.3 | 30.95 | 28.44 | 29.6 |
BigBench(0次射擊) | 32.6 | 33.08 | 32.99 | 33.26 |
平均值 | 51.78 | 52.51 | 51.71 | 52.2 |
相關模型
模型 | 類型 | 數據 | 基礎模型 | 參數數量 | 下載鏈接 |
---|---|---|---|---|---|
泰米爾語LLaMA 7B v0.1基礎模型 | 基礎模型 | 12GB | LLaMA 7B | 70億 | HF Hub |
泰米爾語LLaMA 13B v0.1基礎模型 | 基礎模型 | 4GB | LLaMA 13B | 130億 | HF Hub |
泰米爾語LLaMA 7B v0.1指令模型 | 指令跟隨模型 | 14.5萬條指令 | 泰米爾語LLaMA 7B基礎模型 | 70億 | HF Hub |
泰米爾語LLaMA 13B v0.1指令模型 | 指令跟隨模型 | 14.5萬條指令 | 泰米爾語LLaMA 13B基礎模型 | 130億 | HF Hub |
泰盧固語LLaMA 7B v0.1指令模型 | 指令/聊天模型 | 42萬條指令 | 泰盧固語LLaMA 7B基礎模型v0.1 | 70億 | HF Hub |
馬拉雅拉姆語LLaMA 7B v0.2指令模型 | 指令/聊天模型 | 42萬條指令 | 馬拉雅拉姆語LLaMA 7B基礎模型v0.1 | 70億 | HF Hub |
使用注意事項
⚠️ 重要提示
請注意,這些模型未經過去毒化/審查處理。因此,雖然它們具有出色的語言能力,但有可能生成被認為有害或冒犯性的內容。我們敦促用戶謹慎使用,並密切監督模型的輸出,特別是在公共或敏感應用場景中。
開發者介紹
認識一下這款創新模型背後的開發者,並關注他們在該領域的貢獻:
引用
如果您在研究中使用了該模型或任何與泰米爾語LLaMA相關的工作,請引用:
@misc{balachandran2023tamilllama,
title={Tamil-Llama: A New Tamil Language Model Based on Llama 2},
author={Abhinand Balachandran},
year={2023},
eprint={2311.05845},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
我們希望該模型能成為您自然語言處理工具包中的寶貴工具,並期待看到它在泰米爾語理解和生成方面帶來的進步。
Phi 2 GGUF
其他
Phi-2是微軟開發的一個小型但強大的語言模型,具有27億參數,專注於高效推理和高質量文本生成。
大型語言模型 支持多種語言
P
TheBloke
41.5M
205
Roberta Large
MIT
基於掩碼語言建模目標預訓練的大型英語語言模型,採用改進的BERT訓練方法
大型語言模型 英語
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERT是BERT基礎模型的蒸餾版本,在保持相近性能的同時更輕量高效,適用於序列分類、標記分類等自然語言處理任務。
大型語言模型 英語
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instruct 是一個多語言大語言模型,針對多語言對話用例進行了優化,在常見的行業基準測試中表現優異。
大型語言模型 英語
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM-RoBERTa是基於100種語言的2.5TB過濾CommonCrawl數據預訓練的多語言模型,採用掩碼語言建模目標進行訓練。
大型語言模型 支持多種語言
X
FacebookAI
9.6M
664
Roberta Base
MIT
基於Transformer架構的英語預訓練模型,通過掩碼語言建模目標在海量文本上訓練,支持文本特徵提取和下游任務微調
大型語言模型 英語
R
FacebookAI
9.3M
488
Opt 125m
其他
OPT是由Meta AI發佈的開放預訓練Transformer語言模型套件,參數量從1.25億到1750億,旨在對標GPT-3系列性能,同時促進大規模語言模型的開放研究。
大型語言模型 英語
O
facebook
6.3M
198
1
基於transformers庫的預訓練模型,適用於多種NLP任務
大型語言模型
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1是Meta推出的多語言大語言模型系列,包含8B、70B和405B參數規模,支持8種語言和代碼生成,優化了多語言對話場景。
大型語言模型
Transformers 支持多種語言

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5基礎版是由Google開發的文本到文本轉換Transformer模型,參數規模2.2億,支持多語言NLP任務。
大型語言模型 支持多種語言
T
google-t5
5.4M
702
精選推薦AI模型
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers 支持多種語言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 中文
R
uer
2,694
98