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

  • Log In
  • Sign Up

peft-internal-testing
/
tiny-random-GPTJForCausalLM

Text Generation
Transformers
Safetensors
gptj
Model card Files Files and versions
xet
Community

Instructions to use peft-internal-testing/tiny-random-GPTJForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use peft-internal-testing/tiny-random-GPTJForCausalLM with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="peft-internal-testing/tiny-random-GPTJForCausalLM")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("peft-internal-testing/tiny-random-GPTJForCausalLM")
    model = AutoModelForCausalLM.from_pretrained("peft-internal-testing/tiny-random-GPTJForCausalLM")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use peft-internal-testing/tiny-random-GPTJForCausalLM with vLLM:

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

    How to use peft-internal-testing/tiny-random-GPTJForCausalLM 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 "peft-internal-testing/tiny-random-GPTJForCausalLM" \
        --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": "peft-internal-testing/tiny-random-GPTJForCausalLM",
    		"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 "peft-internal-testing/tiny-random-GPTJForCausalLM" \
            --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": "peft-internal-testing/tiny-random-GPTJForCausalLM",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use peft-internal-testing/tiny-random-GPTJForCausalLM with Docker Model Runner:

    docker model run hf.co/peft-internal-testing/tiny-random-GPTJForCausalLM
tiny-random-GPTJForCausalLM
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
BenjaminB's picture
BenjaminB HF Staff
Upload tokenizer
aee41a2 verified 6 months ago
  • .gitattributes
    1.52 kB
    initial commit 6 months ago
  • README.md
    5.17 kB
    Upload GPTJForCausalLM 6 months ago
  • config.json
    743 Bytes
    Upload GPTJForCausalLM 6 months ago
  • generation_config.json
    139 Bytes
    Upload GPTJForCausalLM 6 months ago
  • merges.txt
    4.57 kB
    Upload tokenizer 6 months ago
  • model.safetensors
    522 kB
    xet
    Upload GPTJForCausalLM 6 months ago
  • special_tokens_map.json
    438 Bytes
    Upload tokenizer 6 months ago
  • tokenizer.json
    53.4 kB
    Upload tokenizer 6 months ago
  • tokenizer_config.json
    540 Bytes
    Upload tokenizer 6 months ago
  • vocab.json
    10.5 kB
    Upload tokenizer 6 months ago