Skip to content
This repository was archived by the owner on Sep 20, 2025. It is now read-only.

Commit 520ad44

Browse files
committed
cleanup
1 parent 1d7f4c1 commit 520ad44

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

src/emd/models/engines.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,12 @@ class KtransformersEngine(OpenAICompitableEngine):
381381
"base_image_host":"public.ecr.aws",
382382
"use_public_ecr":True,
383383
"docker_login_region":"us-east-1",
384-
}
385-
)
384+
})
386385

387386
ktransformers_engine = KtransformersEngine(**{
388387
"engine_type":EngineType.KTRANFORMERS,
389388
"engine_cls":"ktransformers.ktransformers_backend.KTransformersBackend",
390389
"base_image_host":"nvcr.io",
391390
"use_public_ecr":False,
392-
"default_cli_args": " --max_new_tokens 2048"
393-
}
394-
)
391+
"default_cli_args": " --max_new_tokens 2048",
392+
})

src/pipeline/backend/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def gpu_num(self):
8787
if self.custom_gpu_num is not None:
8888
return self.custom_gpu_num
8989
return get_gpu_num()
90-
90+
9191
@property
9292
def cpu_num(self):
9393
return get_cpu_num()

src/pipeline/backend/ktransformers/DeepSeek-R1/configuration_deepseek.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,4 @@ def __init__(
207207
eos_token_id=eos_token_id,
208208
tie_word_embeddings=tie_word_embeddings,
209209
**kwargs,
210-
)
210+
)

src/pipeline/backend/ktransformers/DeepSeek-R1/tokenizer_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
"unk_token": null,
3333
"tokenizer_class": "LlamaTokenizerFast",
3434
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='', is_first_sp=true) %}{%- for message in messages %}{%- if message['role'] == 'system' %}{%- if ns.is_first_sp %}{% set ns.system_prompt = ns.system_prompt + message['content'] %}{% set ns.is_first_sp = false %}{%- else %}{% set ns.system_prompt = ns.system_prompt + '\\n\\n' + message['content'] %}{%- endif %}{%- endif %}{%- endfor %}{{ bos_token }}{{ ns.system_prompt }}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and 'tool_calls' in message %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls'] %}{%- if not ns.is_first %}{%- if message['content'] is none %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- else %}{{'<|Assistant|>' + message['content'] + '<|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- endif %}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- endif %}{%- endfor %}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- if message['role'] == 'assistant' and 'tool_calls' not in message %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %}"
35-
}
35+
}

0 commit comments

Comments
 (0)