模型简介
模型特点
模型能力
使用案例
🚀 Ghost 7B v0.9.1
Ghost 7B v0.9.1 是 Ghost 7B Alpha 模型的早期版本,这一新一代大语言模型专注于优化,以实现出色的推理能力和多任务知识处理能力。你可以在 Google Colab 上体验该模型。此外,该模型还有 GUFF 和 AWQ 版本。
快来根据你的需求创建专属AI助手吧!
无论是使用越南语:
还是英语:
让你的助手成为专家,甚至更强大!
挑战模型的语言理解能力:
使用越南语挑战模型的推理能力:
当使用缺少重音、缩写或俚语的越南语时:
✨ 主要特性
模型详情
模型描述
该版本在生成非初始训练语言(如越南语)时会考虑语言理解能力。Mistral 7B 模型在新语言训练方面效果出色且成本较低。
我重新训练了 Ghost 7B v0.9.0 模型,使用的数据量较小,约为 150MB。其中约 70% 是越南语数据,其余几乎为英语数据。这里采用 QLora 进行训练然后合并,非常感谢 Unsloth 提供的功能。
模型用途
在线使用 Google Colab
为了方便体验模型,我在 Google Colab 上创建了一个笔记本,你可以直接开始实验。
直接使用
按照以下步骤,你可以轻松开始直接使用该模型:
- 首先,使用
pip
命令安装 transformers:
pip install -U transformers
- 现在,你可以直接开始使用模型:
import torch
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
)
base_model = "lamhieu/ghost-7b-v0.9.1"
model = AutoModelForCausalLM.from_pretrained(
base_model,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(base_model)
messages = [
{"role": "system", "content": "You are a friendly chatbot who always responds in the style of a pirate"},
{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
tokenized = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
outputs = model.generate(**tokenized, max_new_tokens=512)
results = tokenizer.batch_decode(outputs)[0]
print(results)
- 此外,你还可以使用 4bit 量化 模型以减少资源需求:
import torch
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
BitsAndBytesConfig,
)
base_model = "lamhieu/ghost-7b-v0.9.1"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=False,
)
model = AutoModelForCausalLM.from_pretrained(
base_model,
quantization_config=bnb_config,
trust_remote_code=True,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(base_model)
messages = [
{"role": "system", "content": "You are a friendly chatbot who always responds in the style of a pirate"},
{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
tokenized = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
outputs = model.generate(**tokenized, max_new_tokens=512)
results = tokenizer.batch_decode(outputs)[0]
print(results)
总结
尽管训练数据量较小,但模型表现出色,你无需担心它无法满足你的需求。不妨尝试用它来实现你的想法。
该模型的使用方式与 ChatGPT 类似,我特意对其进行了调整,使其能够在某些任务上替代我的应用程序,并且表现良好。它支持越南语和英语。欢迎在讨论区留下你的使用反馈。
设置系统提示对模型生成内容的性能和质量有很大影响,请牢记这一点,以确保模型按你的预期使用,目标是取得良好的效果。最好始终设置系统提示,如果你不想设置,也可以留空。
🔧 技术细节
Open LLM Leaderboard 评估结果
详细结果可查看 此处
指标 | 值 |
---|---|
平均值 | 55.10 |
AI2 推理挑战(25 次样本学习) | 55.38 |
HellaSwag(10 次样本学习) | 77.03 |
MMLU(5 次样本学习) | 54.78 |
TruthfulQA(0 次样本学习) | 43.96 |
Winogrande(5 次样本学习) | 72.53 |
GSM8k(5 次样本学习) | 26.91 |
VMLU
VMLU 是一个用于大语言模型的越南语多任务语言理解基准测试套件。在评估时,该模型在 VMLU 的“微调模型排行榜”中排名第 3。
详情
{
"humanity": {
"administrative_law": 52.22,
"business_law": 40.22,
"civil_law": 46.11,
"criminal_law": 49.08,
"economic_law": 39.75,
"education_law": 42.17,
"elementary_history": 55.37,
"high_school_history": 36.67,
"high_school_literature": 37.78,
"history_of_world_civilization": 46.67,
"idealogical_and_moral_cultivation": 50,
"introduction_to_laws": 45.24,
"vietnamese_language_and_literature": 34.48,
"total": 43.3,
"revolutionary_policy_of_the_vietnamese_commununist_part": 51.11,
"introduction_to_vietnam_culture": 30.56,
"logic": 27.01,
"middle_school_history": 44.44,
"middle_school_literature": 50.57
},
"stem": {
"total": 34.73,
"applied_informatics": 50.56,
"computer_architecture": 33.89,
"computer_network": 43.02,
"discrete_mathematics": 31.52,
"electrical_engineering": 30.68,
"elementary_mathematics": 30,
"elementary_science": 58.89,
"high_school_biology": 38.33,
"high_school_chemistry": 28.89,
"high_school_mathematics": 26.35,
"high_school_physics": 29.44,
"introduction_to_chemistry": 27.37,
"introduction_to_physics": 31.79,
"introduction_to_programming": 36.31,
"metrology_engineer": 31.21,
"middle_school_biology": 46.47,
"middle_school_chemistry": 30.56,
"middle_school_mathematics": 30.56,
"middle_school_physics": 30,
"operating_system": 40.56,
"statistics_and_probability": 22.99
},
"total": 39.58,
"other": {
"accountant": 31.55,
"civil_servant": 42.11,
"clinical_pharmacology": 33.89,
"driving_license_certificate": 59.06,
"environmental_engineering": 28.07,
"internal_basic_medicine": 39.77,
"preschool_pedagogy": 46.08,
"tax_accountant": 22.41,
"tax_civil_servant": 47.95,
"total": 38.99
},
"social_science": {
"business_administration": 41.38,
"high_school_civil_education": 45,
"high_school_geography": 34.57,
"ho_chi_minh_ideology": 48.04,
"macroeconomics": 31.11,
"microeconomics": 37.22,
"middle_school_civil_education": 66.29,
"middle_school_geography": 48.3,
"principles_of_marxism_and_leninism": 30,
"sociology": 53.93,
"total": 43.58
}
}
更多信息
注意,这是一个个人研究项目,预算有限,因此模型仅停留在使用所开发方法进行评估的阶段。不过,我认为使用这种方法肯定可以构建出在语言和其他性能方面质量更好的模型。
感谢支持
模型使用 Unsloth 进行训练,非常感谢!

📄 许可证
本项目采用 MIT 许可证。
📚 详细文档
模型卡片联系方式
Lam Hieu (lamhieu.vk@gmail.com)



