Instructions to use junelegend/llama-3-docker-command-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use junelegend/llama-3-docker-command-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="junelegend/llama-3-docker-command-lora")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("junelegend/llama-3-docker-command-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use junelegend/llama-3-docker-command-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "junelegend/llama-3-docker-command-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "junelegend/llama-3-docker-command-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/junelegend/llama-3-docker-command-lora
- SGLang
How to use junelegend/llama-3-docker-command-lora 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 "junelegend/llama-3-docker-command-lora" \ --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": "junelegend/llama-3-docker-command-lora", "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 "junelegend/llama-3-docker-command-lora" \ --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": "junelegend/llama-3-docker-command-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use junelegend/llama-3-docker-command-lora with Docker Model Runner:
docker model run hf.co/junelegend/llama-3-docker-command-lora
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,6 +9,9 @@ tags:
|
|
| 9 |
- llama
|
| 10 |
- trl
|
| 11 |
base_model: unsloth/llama-3-8b-bnb-4bit
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# Uploaded model
|
|
@@ -17,6 +20,36 @@ base_model: unsloth/llama-3-8b-bnb-4bit
|
|
| 17 |
- **License:** apache-2.0
|
| 18 |
- **Finetuned from model :** unsloth/llama-3-8b-bnb-4bit
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
| 21 |
|
| 22 |
-
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
|
| 9 |
- llama
|
| 10 |
- trl
|
| 11 |
base_model: unsloth/llama-3-8b-bnb-4bit
|
| 12 |
+
datasets:
|
| 13 |
+
- adeocybersecurity/DockerCommand
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
---
|
| 16 |
|
| 17 |
# Uploaded model
|
|
|
|
| 20 |
- **License:** apache-2.0
|
| 21 |
- **Finetuned from model :** unsloth/llama-3-8b-bnb-4bit
|
| 22 |
|
| 23 |
+
## Model Details
|
| 24 |
+
|
| 25 |
+
This model is finetuned on [adeocybersecurity/DockerCommand](https://huggingface.co/datasets/adeocybersecurity/DockerCommand) dataset using the base [unsloth/llama-3-8b-bnb-4bit](https://huggingface.co/unsloth/llama-3-8b-bnb-4bit) model. These are only the lora adapaters of the model, the base model is automatically downloaded.
|
| 26 |
+
|
| 27 |
+
## How to use
|
| 28 |
+
|
| 29 |
+
```
|
| 30 |
+
from unsloth import FastLanguageModel
|
| 31 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 32 |
+
model_name = "llama-3-docker-command-lora", # YOUR MODEL YOU USED FOR TRAINING
|
| 33 |
+
max_seq_length = max_seq_length,
|
| 34 |
+
dtype = dtype,
|
| 35 |
+
load_in_4bit = load_in_4bit,
|
| 36 |
+
)
|
| 37 |
+
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
| 38 |
+
|
| 39 |
+
inputs = tokenizer(
|
| 40 |
+
[
|
| 41 |
+
alpaca_prompt.format(
|
| 42 |
+
"translate this sentence in docker command.", # instruction
|
| 43 |
+
"Give me a list of all containers, indicating their status as well.", # input
|
| 44 |
+
"", # output - leave this blank for generation!
|
| 45 |
+
)
|
| 46 |
+
], return_tensors = "pt").to("cuda")
|
| 47 |
+
|
| 48 |
+
outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True)
|
| 49 |
+
tokenizer.batch_decode(outputs)
|
| 50 |
+
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
| 54 |
|
| 55 |
+
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|