Text Generation
PEFT
Safetensors
Transformers
lora
soft-prompt
instruction-generation
conversational
Instructions to use Suryanshg/General-DoD-translator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Suryanshg/General-DoD-translator with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct") model = PeftModel.from_pretrained(base_model, "Suryanshg/General-DoD-translator") - Transformers
How to use Suryanshg/General-DoD-translator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Suryanshg/General-DoD-translator") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Suryanshg/General-DoD-translator", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Suryanshg/General-DoD-translator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Suryanshg/General-DoD-translator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Suryanshg/General-DoD-translator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Suryanshg/General-DoD-translator
- SGLang
How to use Suryanshg/General-DoD-translator 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 "Suryanshg/General-DoD-translator" \ --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": "Suryanshg/General-DoD-translator", "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 "Suryanshg/General-DoD-translator" \ --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": "Suryanshg/General-DoD-translator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Suryanshg/General-DoD-translator with Docker Model Runner:
docker model run hf.co/Suryanshg/General-DoD-translator
Soft-to-Hard Prompt Translator
LoRA adapter that translates soft prompt embeddings into natural-language task instructions. Part of the "Learning to Translate from Soft to Hard LLM Prompts" project.
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = AutoModelForCausalLM.from_pretrained(
"meta-llama/Llama-3.1-8B-Instruct", torch_dtype="auto", device_map="auto",
)
model = PeftModel.from_pretrained(base_model, "<path-to-adapter>")
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
Training Details
| Parameter | Value |
|---|---|
| Base model | meta-llama/Llama-3.1-8B-Instruct |
| LoRA rank | 4 |
| LoRA alpha | 8 |
| Dropout | 0.1 |
| Target modules | up_proj, gate_proj, down_proj, q_proj, o_proj, v_proj, k_proj |
| PEFT version | 0.18.0 |
- Downloads last month
- -
Model tree for Suryanshg/General-DoD-translator
Base model
meta-llama/Llama-3.1-8B Finetuned
meta-llama/Llama-3.1-8B-Instruct