Text Generation
Transformers
PyTorch
Safetensors
English
Chinese
llama
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use GeneZC/MiniChat-1.5-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GeneZC/MiniChat-1.5-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GeneZC/MiniChat-1.5-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GeneZC/MiniChat-1.5-3B") model = AutoModelForCausalLM.from_pretrained("GeneZC/MiniChat-1.5-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GeneZC/MiniChat-1.5-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GeneZC/MiniChat-1.5-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeneZC/MiniChat-1.5-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GeneZC/MiniChat-1.5-3B
- SGLang
How to use GeneZC/MiniChat-1.5-3B 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 "GeneZC/MiniChat-1.5-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeneZC/MiniChat-1.5-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "GeneZC/MiniChat-1.5-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeneZC/MiniChat-1.5-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GeneZC/MiniChat-1.5-3B with Docker Model Runner:
docker model run hf.co/GeneZC/MiniChat-1.5-3B
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,7 +10,12 @@ widget:
|
|
| 10 |
|
| 11 |
## MiniChat-1.5-3B
|
| 12 |
|
| 13 |
-
📑 [arXiv](https://arxiv.org/abs/2311.07052) | 👻 [GitHub](https://github.com/GeneZC/MiniMA) | 🤗 [HuggingFace-MiniMA](https://huggingface.co/GeneZC/MiniMA-3B) | 🤗 [HuggingFace-MiniChat](https://huggingface.co/GeneZC/MiniChat-3B) | 🤖 [ModelScope-MiniMA](https://modelscope.cn/models/GeneZC/MiniMA-3B) | 🤖 [ModelScope-MiniChat](https://modelscope.cn/models/GeneZC/MiniChat-3B)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
❗ Must comply with LICENSE of LLaMA2 since it is derived from LLaMA2.
|
| 16 |
|
|
@@ -18,8 +23,6 @@ A language model distilled and finetuned from an adapted version of LLaMA2-7B fo
|
|
| 18 |
|
| 19 |
Outperforming a wide range of 3B competitors in GPT4 evaluation and even competing with several 7B chat models.
|
| 20 |
|
| 21 |
-
**Updates from MiniChat-3B**: 1) better data mixture; 2) use of [NEFTune](https://arxiv.org/abs/2310.05914); 3) use of [DPO](https://arxiv.org/abs/2305.18290)
|
| 22 |
-
|
| 23 |
<img src="./teaser_b.jpg" alt="teaser_b" width="687" />
|
| 24 |
|
| 25 |
The following is an example code snippet to use MiniChat-3B:
|
|
|
|
| 10 |
|
| 11 |
## MiniChat-1.5-3B
|
| 12 |
|
| 13 |
+
📑 [arXiv](https://arxiv.org/abs/2311.07052) | 👻 [GitHub](https://github.com/GeneZC/MiniMA) | 🤗 [HuggingFace-MiniMA](https://huggingface.co/GeneZC/MiniMA-3B) | 🤗 [HuggingFace-MiniChat](https://huggingface.co/GeneZC/MiniChat-3B) | 🤗 [HuggingFace-MiniChat-1.5](https://huggingface.co/GeneZC/MiniChat-1.5-3B) | 🤖 [ModelScope-MiniMA](https://modelscope.cn/models/GeneZC/MiniMA-3B) | 🤖 [ModelScope-MiniChat](https://modelscope.cn/models/GeneZC/MiniChat-3B)
|
| 14 |
+
|
| 15 |
+
🆕 **Updates from MiniChat-3B**:
|
| 16 |
+
- better data mixture;
|
| 17 |
+
- use of [NEFTune](https://arxiv.org/abs/2310.05914);
|
| 18 |
+
- use of [DPO](https://arxiv.org/abs/2305.18290).
|
| 19 |
|
| 20 |
❗ Must comply with LICENSE of LLaMA2 since it is derived from LLaMA2.
|
| 21 |
|
|
|
|
| 23 |
|
| 24 |
Outperforming a wide range of 3B competitors in GPT4 evaluation and even competing with several 7B chat models.
|
| 25 |
|
|
|
|
|
|
|
| 26 |
<img src="./teaser_b.jpg" alt="teaser_b" width="687" />
|
| 27 |
|
| 28 |
The following is an example code snippet to use MiniChat-3B:
|