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 ·
d3aecca
1
Parent(s): 637a035
Update README.md
Browse files
README.md
CHANGED
|
@@ -31,6 +31,17 @@ tags:
|
|
| 31 |
---
|
| 32 |

|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
## MMLU:
|
| 35 |
stem ACC: 56.83
|
| 36 |
|
|
|
|
| 31 |
---
|
| 32 |

|
| 33 |
|
| 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.3 billion sentences 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 |
+
|
| 41 |
+
Please note that the model was trained on unfiltered internet data. Since we do not have the capacity to vet all of it, there may be a substantial amount of objectionable content, pornography, violence, and offensive language present that we are unable to remove. Therefore, you will still need to complete your own checks on the model's safety and filter keywords in the output. Due to computational resource constraints, we are presently unable to implement RLHF for the model's ethics and safety, nor training on SFT samples that refuse to answer certain questions for restrictive fine-tuning.
|
| 42 |
+
|
| 43 |
+
Bonus: The model underwent some fine-tuning on the prompt format introduced in LLaVA1.5 that is unrelated to image attention calculation. Therefore, aligning the ViT Projection module with frozen LMunder visual instructions would enable rapid implementation of effective multimodal capabilities.
|
| 44 |
+
|
| 45 |
## MMLU:
|
| 46 |
stem ACC: 56.83
|
| 47 |
|