MCPcopy
hub / github.com/QwenLM/Qwen-Audio / get_stop_words_ids

Function get_stop_words_ids

qwen_generation_utils.py:109–116  ·  view source on GitHub ↗
(chat_format, tokenizer)

Source from the content-addressed store, hash-verified

107
108
109def get_stop_words_ids(chat_format, tokenizer):
110 if chat_format == "raw":
111 stop_words_ids = [tokenizer.encode("Human:"), [tokenizer.eod_id]]
112 elif chat_format == "chatml":
113 stop_words_ids = [[tokenizer.im_end_id], [tokenizer.im_start_id]]
114 else:
115 raise NotImplementedError(f"Unknown chat format {chat_format!r}")
116 return stop_words_ids
117
118
119def make_context(

Callers 2

chatMethod · 0.85
chat_streamMethod · 0.85

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected