Text Generation
Transformers
Safetensors
Chinese
English
joyai_llm_flash
conversational
custom_code
Eval Results
Instructions to use jdopensource/JoyAI-LLM-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jdopensource/JoyAI-LLM-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jdopensource/JoyAI-LLM-Flash", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("jdopensource/JoyAI-LLM-Flash", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use jdopensource/JoyAI-LLM-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jdopensource/JoyAI-LLM-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jdopensource/JoyAI-LLM-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jdopensource/JoyAI-LLM-Flash
- SGLang
How to use jdopensource/JoyAI-LLM-Flash 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 "jdopensource/JoyAI-LLM-Flash" \ --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": "jdopensource/JoyAI-LLM-Flash", "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 "jdopensource/JoyAI-LLM-Flash" \ --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": "jdopensource/JoyAI-LLM-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jdopensource/JoyAI-LLM-Flash with Docker Model Runner:
docker model run hf.co/jdopensource/JoyAI-LLM-Flash
Update modeling_deepseek.py
Browse files- modeling_deepseek.py +1 -5
modeling_deepseek.py
CHANGED
|
@@ -22,7 +22,6 @@ from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_u
|
|
| 22 |
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 23 |
from transformers.processing_utils import Unpack
|
| 24 |
from transformers.utils import (
|
| 25 |
-
LossKwargs,
|
| 26 |
add_start_docstrings,
|
| 27 |
add_start_docstrings_to_model_forward,
|
| 28 |
can_return_tuple,
|
|
@@ -903,9 +902,6 @@ class DeepseekV3Model(DeepseekV3PreTrainedModel):
|
|
| 903 |
return causal_mask
|
| 904 |
|
| 905 |
|
| 906 |
-
class KwargsForCausalLM(FlashAttentionKwargs, LossKwargs): ...
|
| 907 |
-
|
| 908 |
-
|
| 909 |
class DeepseekV3ForCausalLM(DeepseekV3PreTrainedModel, GenerationMixin):
|
| 910 |
_tied_weights_keys = ["lm_head.weight"]
|
| 911 |
_tp_plan = {"lm_head": "colwise_rep"}
|
|
@@ -955,7 +951,7 @@ class DeepseekV3ForCausalLM(DeepseekV3PreTrainedModel, GenerationMixin):
|
|
| 955 |
output_hidden_states: Optional[bool] = None,
|
| 956 |
cache_position: Optional[torch.LongTensor] = None,
|
| 957 |
logits_to_keep: Union[int, torch.Tensor] = 0,
|
| 958 |
-
**kwargs
|
| 959 |
) -> CausalLMOutputWithPast:
|
| 960 |
r"""
|
| 961 |
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
|
|
|
| 22 |
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 23 |
from transformers.processing_utils import Unpack
|
| 24 |
from transformers.utils import (
|
|
|
|
| 25 |
add_start_docstrings,
|
| 26 |
add_start_docstrings_to_model_forward,
|
| 27 |
can_return_tuple,
|
|
|
|
| 902 |
return causal_mask
|
| 903 |
|
| 904 |
|
|
|
|
|
|
|
|
|
|
| 905 |
class DeepseekV3ForCausalLM(DeepseekV3PreTrainedModel, GenerationMixin):
|
| 906 |
_tied_weights_keys = ["lm_head.weight"]
|
| 907 |
_tp_plan = {"lm_head": "colwise_rep"}
|
|
|
|
| 951 |
output_hidden_states: Optional[bool] = None,
|
| 952 |
cache_position: Optional[torch.LongTensor] = None,
|
| 953 |
logits_to_keep: Union[int, torch.Tensor] = 0,
|
| 954 |
+
**kwargs
|
| 955 |
) -> CausalLMOutputWithPast:
|
| 956 |
r"""
|
| 957 |
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|