Instructions to use MBZUAI/LaMini-Neo-125M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MBZUAI/LaMini-Neo-125M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MBZUAI/LaMini-Neo-125M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MBZUAI/LaMini-Neo-125M") model = AutoModelForCausalLM.from_pretrained("MBZUAI/LaMini-Neo-125M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MBZUAI/LaMini-Neo-125M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MBZUAI/LaMini-Neo-125M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MBZUAI/LaMini-Neo-125M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MBZUAI/LaMini-Neo-125M
- SGLang
How to use MBZUAI/LaMini-Neo-125M 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 "MBZUAI/LaMini-Neo-125M" \ --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": "MBZUAI/LaMini-Neo-125M", "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 "MBZUAI/LaMini-Neo-125M" \ --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": "MBZUAI/LaMini-Neo-125M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MBZUAI/LaMini-Neo-125M with Docker Model Runner:
docker model run hf.co/MBZUAI/LaMini-Neo-125M
Update README.md
Browse files
README.md
CHANGED
|
@@ -99,7 +99,7 @@ We recommend using the model to respond to human instructions written in natural
|
|
| 99 |
Since this decoder-only model is fine-tuned with wrapper text, we suggest using the same wrapper text to achieve the best performance.
|
| 100 |
See the example on the right or the code below.
|
| 101 |
|
| 102 |
-
We now show you how to load and use our model using HuggingFace `
|
| 103 |
|
| 104 |
```python
|
| 105 |
# pip install -q transformers
|
|
@@ -107,15 +107,15 @@ from transformers import pipeline
|
|
| 107 |
|
| 108 |
checkpoint = "{model_name}"
|
| 109 |
|
| 110 |
-
model = pipeline('text-generation', model
|
| 111 |
|
| 112 |
instruction = 'Please let me know your thoughts on the given place and why you think it deserves to be visited: \n"Barcelona, Spain"'
|
| 113 |
|
| 114 |
input_prompt = f"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:"
|
| 115 |
|
| 116 |
-
generated_text =
|
| 117 |
|
| 118 |
-
print("Response"
|
| 119 |
```
|
| 120 |
|
| 121 |
## Training Procedure
|
|
|
|
| 99 |
Since this decoder-only model is fine-tuned with wrapper text, we suggest using the same wrapper text to achieve the best performance.
|
| 100 |
See the example on the right or the code below.
|
| 101 |
|
| 102 |
+
We now show you how to load and use our model using HuggingFace `pipeline()`.
|
| 103 |
|
| 104 |
```python
|
| 105 |
# pip install -q transformers
|
|
|
|
| 107 |
|
| 108 |
checkpoint = "{model_name}"
|
| 109 |
|
| 110 |
+
model = pipeline('text-generation', model = checkpoint)
|
| 111 |
|
| 112 |
instruction = 'Please let me know your thoughts on the given place and why you think it deserves to be visited: \n"Barcelona, Spain"'
|
| 113 |
|
| 114 |
input_prompt = f"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:"
|
| 115 |
|
| 116 |
+
generated_text = model(input_prompt, max_length=512, do_sample=True)[0]['generated_text']
|
| 117 |
|
| 118 |
+
print("Response", generated_text)
|
| 119 |
```
|
| 120 |
|
| 121 |
## Training Procedure
|