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

  • Log In
  • Sign Up

kulia-moon
/
News2GPT

Text Generation
Transformers
ONNX
Safetensors
Transformers.js
English
gpt2
news
text-generation-inference
Model card Files Files and versions
xet
Community

Instructions to use kulia-moon/News2GPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use kulia-moon/News2GPT with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="kulia-moon/News2GPT")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("kulia-moon/News2GPT")
    model = AutoModelForCausalLM.from_pretrained("kulia-moon/News2GPT")
  • Transformers.js

    How to use kulia-moon/News2GPT with Transformers.js:

    // npm i @huggingface/transformers
    import { pipeline } from '@huggingface/transformers';
    
    // Allocate pipeline
    const pipe = await pipeline('text-generation', 'kulia-moon/News2GPT');
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use kulia-moon/News2GPT with vLLM:

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

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

    How to use kulia-moon/News2GPT with Docker Model Runner:

    docker model run hf.co/kulia-moon/News2GPT
News2GPT
2.35 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 5 commits
kulia-moon's picture
kulia-moon
Update README.md
a91da4a verified about 1 year ago
  • onnx
    Upload folder using huggingface_hub about 1 year ago
  • .gitattributes
    1.52 kB
    initial commit about 1 year ago
  • README.md
    256 Bytes
    Update README.md about 1 year ago
  • config.json
    1.06 kB
    Upload folder using huggingface_hub about 1 year ago
  • generation_config.json
    119 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • merges.txt
    456 kB
    Upload folder using huggingface_hub about 1 year ago
  • model.safetensors
    328 MB
    xet
    Upload folder using huggingface_hub about 1 year ago
  • quantize_config.json
    312 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • special_tokens_map.json
    583 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • tokenizer.json
    3.56 MB
    Upload folder using huggingface_hub about 1 year ago
  • tokenizer_config.json
    556 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • vocab.json
    798 kB
    Upload folder using huggingface_hub about 1 year ago