Question Answering
Transformers
Safetensors
Chinese
English
llama
text-generation
custom_code
text-generation-inference
Run this model with HF Jobs
Run FlagAlpha/Atom-7B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/FlagAlpha/Atom-7B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/FlagAlpha/Atom-7B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use FlagAlpha/Atom-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FlagAlpha/Atom-7B with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="FlagAlpha/Atom-7B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FlagAlpha/Atom-7B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("FlagAlpha/Atom-7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files13 unmodified lines141516171819207 unmodified lines282930313233348 unmodified lines4344454647484950515253545556575859606113 unmodified lines模型的部署、训练、微调等方法详见Llama中文社区GitHub仓库:[**Llama2-Chinese**](https://github.com/FlagAlpha/Llama2-Chinese)。## 中文数据| 类型 | 描述 || ---------------------------------------------------------- | ------------------------------------------------------------ |7 unmodified lines**我们也欢迎大家在[llama.family](https://llama.family)中贡献自己的数据,您的数据通过审核后会加入模型训练,也将影响模型未来的能力走向。**## 中文词表为了提高中文文本处理的效率,我们针对Llama2模型的词表进行了深度优化。8 unmodified lines最终,成功地实现了一种既能提高中文处理效率又能保持Llama2原有性能的方法。## 训练过程**模型结构**:基于当前最优秀的开源模型Llama2,使用主流Decoder-only的标准Transformer网络结构,支持4K的上下文长度(Context Length),为同尺寸模型中最长,能满足更长的多轮对话、知识问答与摘要等需求,模型应用场景更广泛。**FlashAttention-2高效训练**:Atom-7B采用了FlashAttention-2技术进行训练。由于在处理较长的输入序列时,内存消耗的问题可能会导致“内存爆炸”现象。FlashAttention-2是一种高效注意力机制的实现方式之一,相较于传统的注意力技术(Attention),它拥有更快速的速度以及更加优化的内存占用率。**基于NTK的自适应上下文扩展技术**:- 可在不继续训练模型的情况下支持更长的上下文- 本项目中模型默认支持4K上下文,利用上述技术可扩展至18K+- 经过微调可以支持到32K+## 推理配置实际应用中,消费级显卡要比专业显卡便宜的多(比如3090相比A10,同样都是24G显存)。对于消费级显卡,直接FP32肯定放不下,一般最基本的是FP16,而INT8和INT4量化就很有用,例如:13 unmodified lines141516171819207 unmodified lines282930313233348 unmodified lines43444546474849505152535455565758596061626364656613 unmodified lines模型的部署、训练、微调等方法详见Llama中文社区GitHub仓库:[**Llama2-Chinese**](https://github.com/FlagAlpha/Llama2-Chinese)。## 📝 中文数据| 类型 | 描述 || ---------------------------------------------------------- | ------------------------------------------------------------ |7 unmodified lines**我们也欢迎大家在[llama.family](https://llama.family)中贡献自己的数据,您的数据通过审核后会加入模型训练,也将影响模型未来的能力走向。**## 📚 中文词表为了提高中文文本处理的效率,我们针对Llama2模型的词表进行了深度优化。8 unmodified lines最终,成功地实现了一种既能提高中文处理效率又能保持Llama2原有性能的方法。## 📈 训练过程**模型结构**基于当前最优秀的开源模型Llama2,使用主流Decoder-only的标准Transformer网络结构,支持4K的上下文长度(Context Length),为同尺寸模型中最长,能满足更长的多轮对话、知识问答与摘要等需求,模型应用场景更广泛。**FlashAttention-2高效训练**Atom-7B采用了FlashAttention-2技术进行训练。由于在处理较长的输入序列时,内存消耗的问题可能会导致“内存爆炸”现象。FlashAttention-2是一种高效注意力机制的实现方式之一,相较于传统的注意力技术(Attention),它拥有更快速的速度以及更加优化的内存占用率。**基于NTK的自适应上下文扩展技术**- 可在不继续训练模型的情况下支持更长的上下文- 本项目中模型默认支持4K上下文,利用上述技术可扩展至18K+- 经过微调可以支持到32K+## 💻 推理配置实际应用中,消费级显卡要比专业显卡便宜的多(比如3090相比A10,同样都是24G显存)。对于消费级显卡,直接FP32肯定放不下,一般最基本的是FP16,而INT8和INT4量化就很有用,例如:
README.md+12-7