Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

narcolepticchicken
/
safelawbench-model

Text Generation
Transformers
Safetensors
qwen3
Generated from Trainer
sft
hf_jobs
trl
ml-intern
conversational
text-generation-inference
Model card Files Files and versions
xet
Metrics Training metrics Community

Instructions to use narcolepticchicken/safelawbench-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use narcolepticchicken/safelawbench-model with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="narcolepticchicken/safelawbench-model")
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    pipe(messages)
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("narcolepticchicken/safelawbench-model")
    model = AutoModelForCausalLM.from_pretrained("narcolepticchicken/safelawbench-model")
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    inputs = tokenizer.apply_chat_template(
    	messages,
    	add_generation_prompt=True,
    	tokenize=True,
    	return_dict=True,
    	return_tensors="pt",
    ).to(model.device)
    
    outputs = model.generate(**inputs, max_new_tokens=40)
    print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use narcolepticchicken/safelawbench-model with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "narcolepticchicken/safelawbench-model"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "narcolepticchicken/safelawbench-model",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    Use Docker
    docker model run hf.co/narcolepticchicken/safelawbench-model
  • SGLang

    How to use narcolepticchicken/safelawbench-model 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 "narcolepticchicken/safelawbench-model" \
        --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": "narcolepticchicken/safelawbench-model",
    		"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 "narcolepticchicken/safelawbench-model" \
            --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": "narcolepticchicken/safelawbench-model",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
  • Docker Model Runner

    How to use narcolepticchicken/safelawbench-model with Docker Model Runner:

    docker model run hf.co/narcolepticchicken/safelawbench-model
safelawbench-model
16.5 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 20 commits
narcolepticchicken's picture
narcolepticchicken
SFT v12: Full merged 2-epoch SafeLawBench LoRA training
56e85db verified about 15 hours ago
  • .gitattributes
    1.57 kB
    Training in progress, step 500 2 days ago
  • README.md
    4.17 kB
    Update ML Intern artifact metadata 1 day ago
  • adapter_config.json
    1.04 kB
    SFT v12: LoRA 2-epoch SafeLawBench 1 day ago
  • adapter_model.safetensors
    61.4 MB
    xet
    SFT v12: LoRA 2-epoch SafeLawBench 1 day ago
  • chat_template.jinja
    4.17 kB
    Training in progress, step 500 2 days ago
  • config.json
    1.59 kB
    Merged LoRA to Full safetensors (500-step partial checkpoint) 1 day ago
  • generation_config.json
    213 Bytes
    Merged LoRA to Full safetensors (500-step partial checkpoint) 1 day ago
  • model.safetensors
    16.4 GB
    xet
    SFT v12: Full merged 2-epoch SafeLawBench LoRA training about 15 hours ago
  • tokenizer.json
    11.4 MB
    xet
    Training in progress, step 500 2 days ago
  • tokenizer_config.json
    694 Bytes
    Training in progress, step 500 2 days ago