Transformers documentation

IQuestCoder

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v5.23.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

이 모델은 2026-11-12에 Hugging Face Transformers에 기여되었습니다.

FlashAttention SDPA

IQuestCoder

IQuest-Coder-V1는 IQuest Lab이 개발한 코드 언어 모델 계열로, base, instruct, thinking 변형이 포함된 7B, 14B, 40B 크기로 제공됩니다. 아키텍처는 Llama와 동일합니다.

루프형 IQuest-Coder-V1-*-Loop-* 체크포인트는 다른 아키텍처를 사용하며 이 모델에서 지원되지 않습니다.

토크나이저는 체크포인트의 SentencePiece 모델에서 생성됩니다. 이 토큰의 많은 조각이 동일한 점수를 공유하며, SentencePiece는 위치를 기준으로 이러한 동점을 해결합니다. tokenizers 라이브러리는 이를 재현할 수 없으므로, 소수의 텍스트가 원래 원격 코드와 다르게 토큰화됩니다.

auto 클래스는 Llama 구현(LlamaModel 및 LlamaForCausalLM)으로 로드하므로, IQuestCoder에 고유한 것은 IQuestCoderConfig뿐입니다.

아래 예제는 AutoModelForCausalLM 클래스를 사용하여 텍스트를 생성하는 방법을 보여줍니다.

from transformers import AutoModelForCausalLM, AutoTokenizer


tokenizer = AutoTokenizer.from_pretrained("IQuestLab/IQuest-Coder-V1-7B-Instruct")
model = AutoModelForCausalLM.from_pretrained("IQuestLab/IQuest-Coder-V1-7B-Instruct", device_map="auto")

messages = [{"role": "user", "content": "Write a Python function that checks whether a number is prime."}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True)
output = model.generate(**inputs.to(model.device), max_new_tokens=128)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1] :], skip_special_tokens=True))

IQuestCoderConfig

클래스 transformers.IQuestCoderConfig

< >

( transformers_version: str | None = Nonearchitectures: list[str] | None = Noneoutput_hidden_states: bool | None = Falsereturn_dict: bool | None = Truedtype: str | torch.dtype | None = Nonechunk_size_feed_forward: int = 0is_encoder_decoder: bool = Falseid2label: dict[int, str] | dict[str, str] | None = Nonelabel2id: dict[str, int] | dict[str, str] | None = Noneproblem_type: Literal['regression', 'single_label_classification', 'multi_label_classification'] | None = Nonevocab_size: int = 76800hidden_size: int = 5120intermediate_size: int = 27648num_hidden_layers: int = 80num_attention_heads: int = 40num_key_value_heads: int | None = 8hidden_act: str = 'silu'max_position_embeddings: int = 131072initializer_range: float = 0.02rms_norm_eps: float = 1e-05use_cache: bool = Truepad_token_id: int | None = Nonebos_token_id: int | None = 1eos_token_id: int | list[int] | None = 2tie_word_embeddings: bool = Falserope_parameters: transformers.modeling_rope_utils.RopeParameters | dict | None = Noneattention_bias: bool = Falseattention_dropout: float | int = 0.0mlp_bias: bool = Falsehead_dim: int | None = 128 )

매개변수

  • vocab_size (int, 선택 사항, 기본값 76800) — 모델의 어휘 크기입니다. input_ids로 표현할 수 있는 서로 다른 토큰의 수를 정의합니다.
  • hidden_size (int, 선택 사항, 기본값 5120) — 숨겨진 표현의 차원입니다.
  • intermediate_size (int, 선택 사항, 기본값 27648) — MLP 표현의 차원입니다.
  • num_hidden_layers (int, 선택 사항, 기본값 80) — Transformer 디코더의 숨겨진 레이어 수.
  • num_attention_heads (int, 선택 사항, 기본값 40) — Transformer decoder의 각 attention layer에 사용할 attention head의 수입니다.
  • num_key_value_heads (int, 선택 사항, 기본값 8) — Grouped Query Attention 구현에 사용할 key_value 헤드 수입니다. num_key_value_heads=num_attention_heads이면 모델은 Multi Head Attention(MHA)을 사용하고, num_key_value_heads=1이면 Multi Query Attention(MQA)을 사용하며, 그 외에는 GQA를 사용합니다. 멀티 헤드 체크포인트를 GQA 체크포인트로 변환할 때, 각 그룹의 key 및 value 헤드는 해당 그룹 내 모든 원래 헤드를 평균 풀링(meanpooling)하여 구성해야 합니다. 자세한 내용은 이 논문을 참고하세요. 지정하지 않으면 num_attention_heads가 기본값으로 사용됩니다.
  • hidden_act (str, 선택 사항, 기본값 silu) — 디코더의 비선형 활성화 함수(함수 또는 문자열)입니다. 예를 들어, "gelu", "relu", "silu" 등이 있습니다.
  • max_position_embeddings (int, 선택 사항, 기본값 131072) — 이 모델이 사용될 수 있는 최대 시퀀스 길이입니다.
  • initializer_range (float, 선택 사항, 기본값 0.02) — 모든 가중치 행렬을 초기화하는 truncated_normal_initializer의 표준 편차입니다.
  • rms_norm_eps (float, 선택 사항, 기본값 1e-05) — rms 정규화 레이어에서 사용되는 epsilon 값입니다.
  • use_cache (bool, 선택 사항, 기본값 True) — 모델이 마지막 key/values attention을 반환할지 여부입니다(모든 모델에서 사용되지 않음). config.is_decoder=True인 경우 또는 모델이 decoder-only 생성 모델인 경우에만 관련이 있습니다.
  • pad_token_id (int, 선택 사항) — 어휘에서 패딩에 사용되는 토큰 ID입니다.
  • bos_token_id (int, 선택 사항, 기본값 1) — 어휘에서 스트림 시작에 사용되는 토큰 ID입니다.
  • eos_token_id (Union[int, list[int]], 선택 사항, 기본값 2) — 어휘에서 스트림 종료에 사용되는 토큰 ID입니다.
  • tie_word_embeddings (bool, 선택, 기본값 False) — 모델의 tied_weights_keys 매핑에 따라 가중치 임베딩을 묶을지 여부.
  • rope_parameters (Union[~modeling_rope_utils.RopeParameters, dict], 선택) — RoPE 임베딩의 구성 매개변수를 포함하는 사전입니다. 사전에는 rope_theta 값이 포함되어야 하며, 더 긴 max_position_embeddings로 RoPE를 사용하려는 경우 스케일링에 사용되는 매개변수를 선택적으로 포함할 수 있습니다.
  • attention_bias (bool, 선택 사항, 기본값 False) — 자기 주의(self-attention) 시 query, key, value 및 출력 투영 계층에 bias를 사용할지 여부입니다.
  • attention_dropout (Union[float, int], 선택 사항, 기본값 0.0) — Attention 확률에 적용할 dropout 비율입니다.
  • mlp_bias (bool, 선택 사항, 기본값 False) — MLP 레이어의 up_proj, down_proj, gate_proj 레이어에 bias를 사용할지 여부.
  • head_dim (int, 선택 사항, 기본값 128) — Attention head의 차원입니다. None인 경우 hidden_size // num_attention_heads 값이 기본값으로 사용됩니다.

이것은 LlamaModel의 구성을 저장하기 위한 구성 클래스입니다. 지정된 인자에 따라 Iquestcoder 모델을 인스턴스화하고 모델 아키텍처를 정의하는 데 사용됩니다. 기본값으로 구성을 인스턴스화하면 IQuestLab/IQuest-Coder-V1-40B-Instruct와 유사한 구성이 생성됩니다.

Configuration 객체는 PreTrainedConfig를 상속하며 모델 출력을 제어하는 데 사용할 수 있습니다. 자세한 내용은 PreTrainedConfig의 문서를 참고하세요.

>>> from transformers import AutoModelForCausalLM, IQuestCoderConfig

>>> # Initializing an IQuest-Coder-V1-40B style configuration
>>> configuration = IQuestCoderConfig()

>>> # Initializing a model (which uses the Llama implementation) from that configuration
>>> model = AutoModelForCausalLM.from_config(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
Update on GitHub