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

  • Log In
  • Sign Up

lakshaya17
/
phi2-srl

Text Generation
PEFT
TensorBoard
Safetensors
Transformers
lora
Model card Files Files and versions
xet
Metrics Training metrics Community

Instructions to use lakshaya17/phi2-srl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • PEFT

    How to use lakshaya17/phi2-srl with PEFT:

    from peft import PeftModel
    from transformers import AutoModelForCausalLM
    
    base_model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2")
    model = PeftModel.from_pretrained(base_model, "lakshaya17/phi2-srl")
  • Transformers

    How to use lakshaya17/phi2-srl with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="lakshaya17/phi2-srl")
    # Load model directly
    from transformers import AutoModel
    model = AutoModel.from_pretrained("lakshaya17/phi2-srl", dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use lakshaya17/phi2-srl with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "lakshaya17/phi2-srl"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "lakshaya17/phi2-srl",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker
    docker model run hf.co/lakshaya17/phi2-srl
  • SGLang

    How to use lakshaya17/phi2-srl 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 "lakshaya17/phi2-srl" \
        --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": "lakshaya17/phi2-srl",
    		"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 "lakshaya17/phi2-srl" \
            --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": "lakshaya17/phi2-srl",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use lakshaya17/phi2-srl with Docker Model Runner:

    docker model run hf.co/lakshaya17/phi2-srl
phi2-srl
1.63 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 6 commits
lakshaya17's picture
lakshaya17
Upload events.out.tfevents.1757524332.767b14ba6ee4.1189.0
fa20788 verified 8 months ago
  • checkpoint-224
    Upload 31 files 8 months ago
  • checkpoint-448
    Upload 31 files 8 months ago
  • .gitattributes
    1.52 kB
    initial commit 8 months ago
  • README.md
    5.18 kB
    Upload 9 files 8 months ago
  • adapter_config.json
    849 Bytes
    Upload 9 files 8 months ago
  • adapter_model.safetensors
    526 MB
    xet
    Upload 9 files 8 months ago
  • added_tokens.json
    1.1 kB
    Upload 9 files 8 months ago
  • events.out.tfevents.1757524332.767b14ba6ee4.1189.0
    15.1 kB
    xet
    Upload events.out.tfevents.1757524332.767b14ba6ee4.1189.0 8 months ago
  • merges.txt
    456 kB
    Upload 9 files 8 months ago
  • special_tokens_map.json
    579 Bytes
    Upload 9 files 8 months ago
  • tokenizer.json
    3.57 MB
    Upload 9 files 8 months ago
  • tokenizer_config.json
    7.6 kB
    Upload 9 files 8 months ago
  • vocab.json
    798 kB
    Upload 9 files 8 months ago