Text Generation
Transformers
PyTorch
English
Chinese
llama
llama2
qwen
causallm
text-generation-inference
Instructions to use CausalLM/7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CausalLM/7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CausalLM/7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CausalLM/7B") model = AutoModelForCausalLM.from_pretrained("CausalLM/7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use CausalLM/7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CausalLM/7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CausalLM/7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CausalLM/7B
- SGLang
How to use CausalLM/7B 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 "CausalLM/7B" \ --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": "CausalLM/7B", "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 "CausalLM/7B" \ --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": "CausalLM/7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CausalLM/7B with Docker Model Runner:
docker model run hf.co/CausalLM/7B
Commit ·
abec59e
1
Parent(s): b430829
Update README.md
Browse files
README.md
CHANGED
|
@@ -34,7 +34,7 @@ tags:
|
|
| 34 |
## Read Me:
|
| 35 |
This model was trained based on the model weights of Qwen and LLaMA2. The training process utilized a model structure that was identical to LLaMA2, using the same attention calculation method as the original MHA LLaMA2 models, and no additional scaling applied to the Relative Positional Encoding (RoPE).
|
| 36 |
|
| 37 |
-
We manually curated a dataset of 1.
|
| 38 |
|
| 39 |
The 7B version of the model is a distilled version of the 14B model, specifically designed for speculative sampling. However, it is important to exercise caution when directly using the model, as it may produce hallucinations or unreliable outputs.
|
| 40 |
|
|
|
|
| 34 |
## Read Me:
|
| 35 |
This model was trained based on the model weights of Qwen and LLaMA2. The training process utilized a model structure that was identical to LLaMA2, using the same attention calculation method as the original MHA LLaMA2 models, and no additional scaling applied to the Relative Positional Encoding (RoPE).
|
| 36 |
|
| 37 |
+
We manually curated a dataset of 1.3B tokens for training, utilizing open source datasets from Hugging Face. For most of these sentences, we performed manual or synthetic rewrites and generated alternate language versions using larger language models. Additionally, we conducted augmented text training using carefully selected entries from Wikipedia, as well as featured entries from Fandom and filtered entries from Moegirlpedia. In order to strike a balance between efficiency and quality, 100% of the data used for training was synthetic data, no direct use of text from the internet or original texts from publicly available datasets was employed for fine-tuning.
|
| 38 |
|
| 39 |
The 7B version of the model is a distilled version of the 14B model, specifically designed for speculative sampling. However, it is important to exercise caution when directly using the model, as it may produce hallucinations or unreliable outputs.
|
| 40 |
|