Instructions to use ELJAOUHARY/tinyllama-legal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ELJAOUHARY/tinyllama-legal with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0") model = PeftModel.from_pretrained(base_model, "ELJAOUHARY/tinyllama-legal") - Transformers
How to use ELJAOUHARY/tinyllama-legal with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ELJAOUHARY/tinyllama-legal") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ELJAOUHARY/tinyllama-legal", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ELJAOUHARY/tinyllama-legal with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ELJAOUHARY/tinyllama-legal" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ELJAOUHARY/tinyllama-legal", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ELJAOUHARY/tinyllama-legal
- SGLang
How to use ELJAOUHARY/tinyllama-legal 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 "ELJAOUHARY/tinyllama-legal" \ --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": "ELJAOUHARY/tinyllama-legal", "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 "ELJAOUHARY/tinyllama-legal" \ --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": "ELJAOUHARY/tinyllama-legal", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ELJAOUHARY/tinyllama-legal with Docker Model Runner:
docker model run hf.co/ELJAOUHARY/tinyllama-legal
Ctrl+K
- checkpoint-100
- checkpoint-1000
- checkpoint-125
- checkpoint-150
- checkpoint-175
- checkpoint-200
- checkpoint-225
- checkpoint-25
- checkpoint-250
- checkpoint-275
- checkpoint-300
- checkpoint-325
- checkpoint-350
- checkpoint-375
- checkpoint-400
- checkpoint-425
- checkpoint-450
- checkpoint-475
- checkpoint-50
- checkpoint-500
- checkpoint-525
- checkpoint-550
- checkpoint-575
- checkpoint-600
- checkpoint-625
- checkpoint-650
- checkpoint-675
- checkpoint-700
- checkpoint-725
- checkpoint-75
- checkpoint-750
- checkpoint-775
- checkpoint-800
- checkpoint-825
- checkpoint-850
- checkpoint-875
- checkpoint-900
- checkpoint-925
- checkpoint-950
- checkpoint-975
- 1.52 kB
- 5.22 kB
- 1.02 kB
- 9.03 MB xet
- 410 Bytes
- 3.62 MB
- 363 Bytes