Instructions to use naver-hyperclovax/HyperCLOVAX-SEED-Think-14B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use naver-hyperclovax/HyperCLOVAX-SEED-Think-14B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", trust_remote_code=True) 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 naver-hyperclovax/HyperCLOVAX-SEED-Think-14B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/naver-hyperclovax/HyperCLOVAX-SEED-Think-14B
- SGLang
How to use naver-hyperclovax/HyperCLOVAX-SEED-Think-14B 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 "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B" \ --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": "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", "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 "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B" \ --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": "naver-hyperclovax/HyperCLOVAX-SEED-Think-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use naver-hyperclovax/HyperCLOVAX-SEED-Think-14B with Docker Model Runner:
docker model run hf.co/naver-hyperclovax/HyperCLOVAX-SEED-Think-14B
Update modeling_hyperclovax.py
#6
by kibitzing - opened
- modeling_hyperclovax.py +11 -3
modeling_hyperclovax.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
# coding=utf-8
|
| 2 |
# This file was created for the HyperCLOVA X SEED 14B Think architecture.
|
| 3 |
-
# partially copied and modified from
|
|
|
|
| 4 |
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
|
| 5 |
#
|
| 6 |
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
|
|
@@ -43,7 +44,14 @@ from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_u
|
|
| 43 |
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 44 |
from transformers.processing_utils import Unpack
|
| 45 |
from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS
|
| 46 |
-
from transformers.utils import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
from .configuration_hyperclovax import HyperCLOVAXConfig
|
| 48 |
if is_torch_flex_attn_available():
|
| 49 |
from torch.nn.attention.flex_attention import BlockMask
|
|
@@ -620,7 +628,7 @@ class HyperCLOVAXModel(HyperCLOVAXPreTrainedModel):
|
|
| 620 |
return causal_mask
|
| 621 |
|
| 622 |
|
| 623 |
-
class KwargsForCausalLM(FlashAttentionKwargs,
|
| 624 |
|
| 625 |
|
| 626 |
@auto_docstring
|
|
|
|
| 1 |
# coding=utf-8
|
| 2 |
# This file was created for the HyperCLOVA X SEED 14B Think architecture.
|
| 3 |
+
# partially copied and modified from
|
| 4 |
+
# https://github.com/huggingface/transformers/blob/v4.52.4/src/transformers/models/llama/modeling_llama.py
|
| 5 |
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
|
| 6 |
#
|
| 7 |
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
|
|
|
|
| 44 |
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 45 |
from transformers.processing_utils import Unpack
|
| 46 |
from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS
|
| 47 |
+
from transformers.utils import auto_docstring, can_return_tuple, is_torch_flex_attn_available, logging
|
| 48 |
+
try:
|
| 49 |
+
from transformers.utils import LossKwargs
|
| 50 |
+
loss_kwargs_class = LossKwargs
|
| 51 |
+
except ImportError:
|
| 52 |
+
from transformers.utils import TransformersKwargs
|
| 53 |
+
loss_kwargs_class = TransformersKwargs
|
| 54 |
+
|
| 55 |
from .configuration_hyperclovax import HyperCLOVAXConfig
|
| 56 |
if is_torch_flex_attn_available():
|
| 57 |
from torch.nn.attention.flex_attention import BlockMask
|
|
|
|
| 628 |
return causal_mask
|
| 629 |
|
| 630 |
|
| 631 |
+
class KwargsForCausalLM(FlashAttentionKwargs, loss_kwargs_class): ...
|
| 632 |
|
| 633 |
|
| 634 |
@auto_docstring
|