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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<net name="detokenizer" version="11">
|
| 3 |
+
<layers>
|
| 4 |
+
<layer id="0" name="Parameter_629555" type="Parameter" version="opset1">
|
| 5 |
+
<data shape="?,?" element_type="i64" />
|
| 6 |
+
<output>
|
| 7 |
+
<port id="0" precision="I64" names="Parameter_629555">
|
| 8 |
+
<dim>-1</dim>
|
| 9 |
+
<dim>-1</dim>
|
| 10 |
+
</port>
|
| 11 |
+
</output>
|
| 12 |
+
</layer>
|
| 13 |
+
<layer id="1" name="Convert_629571" type="Convert" version="opset1">
|
| 14 |
+
<data destination_type="i32" />
|
| 15 |
+
<input>
|
| 16 |
+
<port id="0" precision="I64">
|
| 17 |
+
<dim>-1</dim>
|
| 18 |
+
<dim>-1</dim>
|
| 19 |
+
</port>
|
| 20 |
+
</input>
|
| 21 |
+
<output>
|
| 22 |
+
<port id="1" precision="I32">
|
| 23 |
+
<dim>-1</dim>
|
| 24 |
+
<dim>-1</dim>
|
| 25 |
+
</port>
|
| 26 |
+
</output>
|
| 27 |
+
</layer>
|
| 28 |
+
<layer id="2" name="Constant_629557" type="Const" version="opset1">
|
| 29 |
+
<data element_type="u8" shape="1623594" offset="0" size="1623594" />
|
| 30 |
+
<output>
|
| 31 |
+
<port id="0" precision="U8">
|
| 32 |
+
<dim>1623594</dim>
|
| 33 |
+
</port>
|
| 34 |
+
</output>
|
| 35 |
+
</layer>
|
| 36 |
+
<layer id="3" name="StringTensorUnpack_629558" type="StringTensorUnpack" version="extension">
|
| 37 |
+
<data mode="begins_ends" />
|
| 38 |
+
<input>
|
| 39 |
+
<port id="0" precision="U8">
|
| 40 |
+
<dim>1623594</dim>
|
| 41 |
+
</port>
|
| 42 |
+
</input>
|
| 43 |
+
<output>
|
| 44 |
+
<port id="1" precision="I32">
|
| 45 |
+
<dim>-1</dim>
|
| 46 |
+
</port>
|
| 47 |
+
<port id="2" precision="I32">
|
| 48 |
+
<dim>-1</dim>
|
| 49 |
+
</port>
|
| 50 |
+
<port id="3" precision="U8">
|
| 51 |
+
<dim>-1</dim>
|
| 52 |
+
</port>
|
| 53 |
+
</output>
|
| 54 |
+
</layer>
|
| 55 |
+
<layer id="4" name="VocabDecoder_629559" type="VocabDecoder" version="extension">
|
| 56 |
+
<data skip_tokens="151329, 151330, 151331, 151332, 151333, 151334, 151335, 151336, 151337, 151338, 151339, 151340, 151341, 151342" />
|
| 57 |
+
<input>
|
| 58 |
+
<port id="0" precision="I32">
|
| 59 |
+
<dim>-1</dim>
|
| 60 |
+
<dim>-1</dim>
|
| 61 |
+
</port>
|
| 62 |
+
<port id="1" precision="I32">
|
| 63 |
+
<dim>-1</dim>
|
| 64 |
+
</port>
|
| 65 |
+
<port id="2" precision="I32">
|
| 66 |
+
<dim>-1</dim>
|
| 67 |
+
</port>
|
| 68 |
+
<port id="3" precision="U8">
|
| 69 |
+
<dim>-1</dim>
|
| 70 |
+
</port>
|
| 71 |
+
</input>
|
| 72 |
+
<output>
|
| 73 |
+
<port id="4" precision="I32">
|
| 74 |
+
<dim>-1</dim>
|
| 75 |
+
</port>
|
| 76 |
+
<port id="5" precision="I32">
|
| 77 |
+
<dim>-1</dim>
|
| 78 |
+
</port>
|
| 79 |
+
<port id="6" precision="I32">
|
| 80 |
+
<dim>-1</dim>
|
| 81 |
+
</port>
|
| 82 |
+
<port id="7" precision="I32">
|
| 83 |
+
<dim>-1</dim>
|
| 84 |
+
</port>
|
| 85 |
+
<port id="8" precision="U8">
|
| 86 |
+
<dim>-1</dim>
|
| 87 |
+
</port>
|
| 88 |
+
</output>
|
| 89 |
+
</layer>
|
| 90 |
+
<layer id="5" name="FuzeRagged_629560" type="FuzeRagged" version="extension">
|
| 91 |
+
<input>
|
| 92 |
+
<port id="0" precision="I32">
|
| 93 |
+
<dim>-1</dim>
|
| 94 |
+
</port>
|
| 95 |
+
<port id="1" precision="I32">
|
| 96 |
+
<dim>-1</dim>
|
| 97 |
+
</port>
|
| 98 |
+
<port id="2" precision="I32">
|
| 99 |
+
<dim>-1</dim>
|
| 100 |
+
</port>
|
| 101 |
+
<port id="3" precision="I32">
|
| 102 |
+
<dim>-1</dim>
|
| 103 |
+
</port>
|
| 104 |
+
</input>
|
| 105 |
+
<output>
|
| 106 |
+
<port id="4" precision="I32">
|
| 107 |
+
<dim>-1</dim>
|
| 108 |
+
</port>
|
| 109 |
+
<port id="5" precision="I32">
|
| 110 |
+
<dim>-1</dim>
|
| 111 |
+
</port>
|
| 112 |
+
</output>
|
| 113 |
+
</layer>
|
| 114 |
+
<layer id="6" name="StringTensorPack_629561" type="StringTensorPack" version="extension">
|
| 115 |
+
<data mode="begins_ends" />
|
| 116 |
+
<input>
|
| 117 |
+
<port id="0" precision="I32">
|
| 118 |
+
<dim>-1</dim>
|
| 119 |
+
</port>
|
| 120 |
+
<port id="1" precision="I32">
|
| 121 |
+
<dim>-1</dim>
|
| 122 |
+
</port>
|
| 123 |
+
<port id="2" precision="U8">
|
| 124 |
+
<dim>-1</dim>
|
| 125 |
+
</port>
|
| 126 |
+
</input>
|
| 127 |
+
<output>
|
| 128 |
+
<port id="3" precision="STRING" names="string_output">
|
| 129 |
+
<dim>-1</dim>
|
| 130 |
+
</port>
|
| 131 |
+
</output>
|
| 132 |
+
</layer>
|
| 133 |
+
<layer id="7" name="Result_629562" type="Result" version="opset1">
|
| 134 |
+
<input>
|
| 135 |
+
<port id="0" precision="STRING">
|
| 136 |
+
<dim>-1</dim>
|
| 137 |
+
</port>
|
| 138 |
+
</input>
|
| 139 |
+
</layer>
|
| 140 |
+
</layers>
|
| 141 |
+
<edges>
|
| 142 |
+
<edge from-layer="0" from-port="0" to-layer="1" to-port="0" />
|
| 143 |
+
<edge from-layer="1" from-port="1" to-layer="4" to-port="0" />
|
| 144 |
+
<edge from-layer="2" from-port="0" to-layer="3" to-port="0" />
|
| 145 |
+
<edge from-layer="3" from-port="1" to-layer="4" to-port="1" />
|
| 146 |
+
<edge from-layer="3" from-port="2" to-layer="4" to-port="2" />
|
| 147 |
+
<edge from-layer="3" from-port="3" to-layer="4" to-port="3" />
|
| 148 |
+
<edge from-layer="4" from-port="4" to-layer="5" to-port="0" />
|
| 149 |
+
<edge from-layer="4" from-port="5" to-layer="5" to-port="1" />
|
| 150 |
+
<edge from-layer="4" from-port="6" to-layer="5" to-port="2" />
|
| 151 |
+
<edge from-layer="4" from-port="7" to-layer="5" to-port="3" />
|
| 152 |
+
<edge from-layer="4" from-port="8" to-layer="6" to-port="2" />
|
| 153 |
+
<edge from-layer="5" from-port="4" to-layer="6" to-port="0" />
|
| 154 |
+
<edge from-layer="5" from-port="5" to-layer="6" to-port="1" />
|
| 155 |
+
<edge from-layer="6" from-port="3" to-layer="7" to-port="0" />
|
| 156 |
+
</edges>
|
| 157 |
+
<rt_info>
|
| 158 |
+
<add_attention_mask value="True" />
|
| 159 |
+
<add_prefix_space />
|
| 160 |
+
<add_special_tokens value="True" />
|
| 161 |
+
<chat_template value="[gMASK]<sop>{% for item in messages %}{% if item['tools'] is defined %}<|system|> 你是一个名为 ChatGLM 的人工智能助手。你是基于智谱AI训练的语言模型 GLM-4 模型开发的,你的任务是针对用户的问题和要求提供适当的答复和支持。 # 可用工具{% set tools = item['tools'] %}{% for tool in tools %}{% if tool['type'] == 'function' %} ## {{ tool['function']['name'] }} {{ tool['function'] | tojson(indent=4) }} 在调用上述函数时,请使用 Json 格式表示调用的参数。{% elif tool['type'] == 'python' %} ## python 当你向 `python` 发送包含 Python 代码的消息时,该代码将会在一个有状态的 Jupyter notebook 环境中执行。 `python` 返回代码执行的输出,或在执行 60 秒后返回超时。 `/mnt/data` 将会持久化存储你的文件。在此会话中,`python` 无法访问互联网。不要使用 `python` 进行任何网络请求或者在线 API 调用,这些在线内容的访问将不会成功。{% elif tool['type'] == 'simple_browser' %} ## simple_browser 你可以使用 `simple_browser` 工具。该工具支持以下函数: `search(query: str, recency_days: int)`:使用搜索引擎进行查询并显示结果,可以使用 `recency_days` 参数控制搜索内容的时效性。 `mclick(ids: list[int])`:获取一系列指定 id 的页面内容。每次调用时,须选择3-10个页面。选择多个角度的页面,同时尽可能选择可信任的信息来源。考虑到部分页面是无法加载的,你也可以多打开一些可能有用的页面而不用担心内容过多。 `open_url(url: str)`:打开指定的 URL。 使用 `【{引用 id}†{引用文本}】` 来引用内容。 操作步骤:1. 使用 `search` 来获得信息列表; 2. 使用 `mclick` 来获取指定 ID 页面的内容; 3. 根据获得的内容进行回复。在回复中应当引用信息来源。 如果用户提供了 URL,也可以用 `open_url` 直接打开页面。 如果初次搜索结果没有找到合适的信息,也可以再次使用 `search` 进行搜索。{% elif tool['type'] == 'cogview' %} ## cogview 如果用户的请求中包含了对图像的描述,你可以使用 `cogview` 来生成图像并展示给用户。你需要向 `cogview` 发送图像描述,规则: - 发送给 `cogview` 的消息必须使用英语。用户的中文描述必须完全翻译为英语。 - 应当尽可能详细地描述图像生成的需求,需求描述约 100 英文单词。 - 保持用户原始描述的意图。不要虚构内容或者没见过的人物。 - 如无特殊说明,所在地为中国,持有中国立场并遵循中国社会主义价值观。{% endif %}{% endfor %}{% endif %}{% if item['content'] %}<|{{ item['role'] }}|>{{ item['metadata'] }} {{ item['content'] }}{% endif %}{% endfor %}{% if add_generation_prompt %}<|assistant|>{% endif %}" />
|
| 162 |
+
<clean_up_tokenization_spaces value="False" />
|
| 163 |
+
<detokenizer_input_type value="i64" />
|
| 164 |
+
<eos_token_id value="151329" />
|
| 165 |
+
<handle_special_tokens_with_re />
|
| 166 |
+
<number_of_inputs value="1" />
|
| 167 |
+
<openvino_tokenizers_version value="2024.5.0.0.dev20241030" />
|
| 168 |
+
<openvino_version value="2024.5.0.dev20241030" />
|
| 169 |
+
<original_tokenizer_class value="<class 'transformers_modules.THUDM.glm-4-9b-chat.eb55a443d66541f30869f6caac5ad0d2e95bcbaa.tokenization_chatglm.ChatGLM4Tokenizer'>" />
|
| 170 |
+
<pad_token_id value="151329" />
|
| 171 |
+
<sentencepiece_version value="0.2.0" />
|
| 172 |
+
<skip_special_tokens value="True" />
|
| 173 |
+
<streaming_detokenizer value="False" />
|
| 174 |
+
<tiktoken_version value="0.8.0" />
|
| 175 |
+
<tokenizer_output_type value="i64" />
|
| 176 |
+
<tokenizers_version value="0.20.1" />
|
| 177 |
+
<transformers_version value="4.45.2" />
|
| 178 |
+
<use_max_padding value="False" />
|
| 179 |
+
<use_sentencepiece_backend value="False" />
|
| 180 |
+
<utf8_replace_mode />
|
| 181 |
+
<with_detokenizer value="True" />
|
| 182 |
+
</rt_info>
|
| 183 |
+
</net>
|