Instructions to use YeungNLP/firefly-bloom-1b4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YeungNLP/firefly-bloom-1b4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="YeungNLP/firefly-bloom-1b4")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("YeungNLP/firefly-bloom-1b4") model = AutoModelForCausalLM.from_pretrained("YeungNLP/firefly-bloom-1b4") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use YeungNLP/firefly-bloom-1b4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "YeungNLP/firefly-bloom-1b4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "YeungNLP/firefly-bloom-1b4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/YeungNLP/firefly-bloom-1b4
- SGLang
How to use YeungNLP/firefly-bloom-1b4 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "YeungNLP/firefly-bloom-1b4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "YeungNLP/firefly-bloom-1b4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "YeungNLP/firefly-bloom-1b4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "YeungNLP/firefly-bloom-1b4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use YeungNLP/firefly-bloom-1b4 with Docker Model Runner:
docker model run hf.co/YeungNLP/firefly-bloom-1b4
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Firefly(流萤): 中文对话式大语言模型
|
| 2 |
|
| 3 |
## 项目简介
|
| 4 |
-
项目地址:[Firefly(流萤):中文对话式大语言模型](https://github.com/yangjianxin1/Firefly)
|
| 5 |

|
| 6 |
|
| 7 |
**Firefly(流萤)** 是一个开源的中文对话式大语言模型,使用指令微调(Instruction Tuning)在中文数据集上进行调优。同时使用了词表裁剪、ZeRO、张量并行等技术,有效降低显存消耗和提高训练效率。
|
|
@@ -79,6 +79,7 @@ Bloom是个多语言模型,由于需要兼容多语言,所以词表有25w之
|
|
| 79 |
|
| 80 |
## 训练细节
|
| 81 |
|
|
|
|
| 82 |
在训练时,对于每条样本,我们将input与target处理成如下格式,然后输出模型中。
|
| 83 |
```
|
| 84 |
<s>input</s></s>target</s>
|
|
@@ -162,7 +163,8 @@ Bloom是个多语言模型,由于需要兼容多语言,所以词表有25w之
|
|
| 162 |
|
| 163 |
|
| 164 |
## 关注我们
|
| 165 |
-
: 中文对话式大语言模型
|
| 2 |
|
| 3 |
## 项目简介
|
| 4 |
+
项目地址:[Firefly(流萤): 中文对话式大语言模型](https://github.com/yangjianxin1/Firefly), 如果您觉得此模型对您有帮助,请like此模型并在Github项目中star我们。
|
| 5 |

|
| 6 |
|
| 7 |
**Firefly(流萤)** 是一个开源的中文对话式大语言模型,使用指令微调(Instruction Tuning)在中文数据集上进行调优。同时使用了词表裁剪、ZeRO、张量并行等技术,有效降低显存消耗和提高训练效率。
|
|
|
|
| 79 |
|
| 80 |
## 训练细节
|
| 81 |
|
| 82 |
+
|
| 83 |
在训练时,对于每条样本,我们将input与target处理成如下格式,然后输出模型中。
|
| 84 |
```
|
| 85 |
<s>input</s></s>target</s>
|
|
|
|
| 163 |
|
| 164 |
|
| 165 |
## 关注我们
|
| 166 |
+

|
| 168 |
|
| 169 |
|
| 170 |
|