Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

IFM
/
K2-Horizon-7B

Text Generation
Transformers
Safetensors
English
k2_horizon
k2-horizon
7b
dense
open-weights
ifm
conversational
custom_code
Model card Files Files and versions
xet
Community
3

Instructions to use IFM/K2-Horizon-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use IFM/K2-Horizon-7B with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="IFM/K2-Horizon-7B", trust_remote_code=True)
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    pipe(messages)
    # Load model directly
    from transformers import AutoModelForCausalLM
    model = AutoModelForCausalLM.from_pretrained("IFM/K2-Horizon-7B", trust_remote_code=True, device_map="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • vLLM

    How to use IFM/K2-Horizon-7B with vLLM:

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

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

    How to use IFM/K2-Horizon-7B with Docker Model Runner:

    docker model run hf.co/IFM/K2-Horizon-7B
K2-Horizon-7B
Ctrl+K
Ctrl+K
  • 7 contributors
History: 13 commits
zhou94539's picture
zhou94539
Upload pytorch_model-00004-of-00036.safetensors to mid_5_ph2
7348857 verified 7 days ago
  • assets
    Initialize private staging repo 8 days ago
  • .gitattributes
    1.6 kB
    Initialize private staging repo 8 days ago
  • README.md
    35.1 kB
    Initialize private staging repo 8 days ago
  • chat_template.jinja
    51 kB
    Upload chat_template.jinja to mid_5_ph2 7 days ago
  • config.json
    1.76 kB
    Upload config.json to mid_5_ph2 7 days ago
  • configuration_k2_horizon.py
    3.53 kB
    Upload configuration_k2_horizon.py to mid_5_ph2 7 days ago
  • generation_config.json
    81 Bytes
    Upload generation_config.json to mid_5_ph2 7 days ago
  • migration_manifest.json
    4.05 kB
    Upload migration_manifest.json to mid_5_ph2 7 days ago
  • model.safetensors.index.json
    29.5 kB
    Upload model.safetensors.index.json to mid_5_ph2 7 days ago
  • modeling_k2_horizon.py
    49.5 kB
    Upload modeling_k2_horizon.py to mid_5_ph2 7 days ago
  • pytorch_model-00001-of-00036.safetensors
    386 MB
    xet
    Upload pytorch_model-00001-of-00036.safetensors to mid_5_ph2 7 days ago
  • pytorch_model-00002-of-00036.safetensors
    386 MB
    xet
    Upload pytorch_model-00002-of-00036.safetensors to mid_5_ph2 7 days ago
  • pytorch_model-00003-of-00036.safetensors
    386 MB
    xet
    Upload pytorch_model-00003-of-00036.safetensors to mid_5_ph2 7 days ago
  • pytorch_model-00004-of-00036.safetensors
    386 MB
    xet
    Upload pytorch_model-00004-of-00036.safetensors to mid_5_ph2 7 days ago