Instructions to use IQuestLab/IQuest-Coder-V1-40B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IQuestLab/IQuest-Coder-V1-40B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IQuestLab/IQuest-Coder-V1-40B-Base", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("IQuestLab/IQuest-Coder-V1-40B-Base", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use IQuestLab/IQuest-Coder-V1-40B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IQuestLab/IQuest-Coder-V1-40B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IQuestLab/IQuest-Coder-V1-40B-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/IQuestLab/IQuest-Coder-V1-40B-Base
- SGLang
How to use IQuestLab/IQuest-Coder-V1-40B-Base 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 "IQuestLab/IQuest-Coder-V1-40B-Base" \ --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": "IQuestLab/IQuest-Coder-V1-40B-Base", "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 "IQuestLab/IQuest-Coder-V1-40B-Base" \ --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": "IQuestLab/IQuest-Coder-V1-40B-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use IQuestLab/IQuest-Coder-V1-40B-Base with Docker Model Runner:
docker model run hf.co/IQuestLab/IQuest-Coder-V1-40B-Base
Update modeling_iquestcoder.py
Browse files- modeling_iquestcoder.py +1 -6
modeling_iquestcoder.py
CHANGED
|
@@ -48,7 +48,6 @@ from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_u
|
|
| 48 |
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 49 |
from transformers.processing_utils import Unpack
|
| 50 |
from transformers.utils import (
|
| 51 |
-
LossKwargs,
|
| 52 |
auto_docstring,
|
| 53 |
can_return_tuple,
|
| 54 |
is_torch_flex_attn_available,
|
|
@@ -705,10 +704,6 @@ class IQuestCoderModel(IQuestCoderPreTrainedModel):
|
|
| 705 |
# Model Heads
|
| 706 |
# =============================================================================
|
| 707 |
|
| 708 |
-
class KwargsForCausalLM(FlashAttentionKwargs, LossKwargs):
|
| 709 |
-
...
|
| 710 |
-
|
| 711 |
-
|
| 712 |
@auto_docstring
|
| 713 |
class IQuestCoderForCausalLM(IQuestCoderPreTrainedModel, GenerationMixin):
|
| 714 |
"""IQuestCoder Model with a language modeling head on top for causal LM."""
|
|
@@ -759,7 +754,7 @@ class IQuestCoderForCausalLM(IQuestCoderPreTrainedModel, GenerationMixin):
|
|
| 759 |
output_hidden_states: Optional[bool] = None,
|
| 760 |
cache_position: Optional[torch.LongTensor] = None,
|
| 761 |
logits_to_keep: Union[int, torch.Tensor] = 0,
|
| 762 |
-
**kwargs
|
| 763 |
) -> CausalLMOutputWithPast:
|
| 764 |
r"""
|
| 765 |
Args:
|
|
|
|
| 48 |
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 49 |
from transformers.processing_utils import Unpack
|
| 50 |
from transformers.utils import (
|
|
|
|
| 51 |
auto_docstring,
|
| 52 |
can_return_tuple,
|
| 53 |
is_torch_flex_attn_available,
|
|
|
|
| 704 |
# Model Heads
|
| 705 |
# =============================================================================
|
| 706 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 707 |
@auto_docstring
|
| 708 |
class IQuestCoderForCausalLM(IQuestCoderPreTrainedModel, GenerationMixin):
|
| 709 |
"""IQuestCoder Model with a language modeling head on top for causal LM."""
|
|
|
|
| 754 |
output_hidden_states: Optional[bool] = None,
|
| 755 |
cache_position: Optional[torch.LongTensor] = None,
|
| 756 |
logits_to_keep: Union[int, torch.Tensor] = 0,
|
| 757 |
+
**kwargs
|
| 758 |
) -> CausalLMOutputWithPast:
|
| 759 |
r"""
|
| 760 |
Args:
|