Instructions to use IQuestLab/IQuest-Coder-V1-40B-Base-Stage1 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-Stage1 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-Stage1", 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-Stage1", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use IQuestLab/IQuest-Coder-V1-40B-Base-Stage1 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-Stage1" # 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-Stage1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/IQuestLab/IQuest-Coder-V1-40B-Base-Stage1
- SGLang
How to use IQuestLab/IQuest-Coder-V1-40B-Base-Stage1 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-Stage1" \ --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-Stage1", "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-Stage1" \ --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-Stage1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use IQuestLab/IQuest-Coder-V1-40B-Base-Stage1 with Docker Model Runner:
docker model run hf.co/IQuestLab/IQuest-Coder-V1-40B-Base-Stage1
Update modeling_iquestcoder.py
Browse files- modeling_iquestcoder.py +26 -14
modeling_iquestcoder.py
CHANGED
|
@@ -1,11 +1,28 @@
|
|
| 1 |
-
"""
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
"""
|
| 10 |
|
| 11 |
from typing import Callable, List, Optional, Tuple, Union
|
|
@@ -31,7 +48,6 @@ from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_u
|
|
| 31 |
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 32 |
from transformers.processing_utils import Unpack
|
| 33 |
from transformers.utils import (
|
| 34 |
-
LossKwargs,
|
| 35 |
auto_docstring,
|
| 36 |
can_return_tuple,
|
| 37 |
is_torch_flex_attn_available,
|
|
@@ -688,10 +704,6 @@ class IQuestCoderModel(IQuestCoderPreTrainedModel):
|
|
| 688 |
# Model Heads
|
| 689 |
# =============================================================================
|
| 690 |
|
| 691 |
-
class KwargsForCausalLM(FlashAttentionKwargs, LossKwargs):
|
| 692 |
-
...
|
| 693 |
-
|
| 694 |
-
|
| 695 |
@auto_docstring
|
| 696 |
class IQuestCoderForCausalLM(IQuestCoderPreTrainedModel, GenerationMixin):
|
| 697 |
"""IQuestCoder Model with a language modeling head on top for causal LM."""
|
|
@@ -742,7 +754,7 @@ class IQuestCoderForCausalLM(IQuestCoderPreTrainedModel, GenerationMixin):
|
|
| 742 |
output_hidden_states: Optional[bool] = None,
|
| 743 |
cache_position: Optional[torch.LongTensor] = None,
|
| 744 |
logits_to_keep: Union[int, torch.Tensor] = 0,
|
| 745 |
-
**kwargs
|
| 746 |
) -> CausalLMOutputWithPast:
|
| 747 |
r"""
|
| 748 |
Args:
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Modified MIT License
|
| 3 |
+
|
| 4 |
+
Software Copyright© 2025 IQuest Research
|
| 5 |
+
|
| 6 |
+
Our only modification is that, if the Software (or any derivative works
|
| 7 |
+
thereof) is used for any of your commercial products or services, you shall
|
| 8 |
+
prominently display "IQuest Coder" on the user interface of such product or
|
| 9 |
+
service.
|
| 10 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 11 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 12 |
+
in the Software without restriction, including without limitation the rights
|
| 13 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 14 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 15 |
+
furnished to do so, subject to the following conditions:
|
| 16 |
+
|
| 17 |
+
The above copyright notice and this permission notice shall be included in all
|
| 18 |
+
copies or substantial portions of the Software.
|
| 19 |
+
|
| 20 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 21 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 22 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 23 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 24 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 25 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 26 |
"""
|
| 27 |
|
| 28 |
from typing import Callable, List, Optional, Tuple, Union
|
|
|
|
| 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:
|