From a2e2192dfe1602f5e7568bbdf520542c680be1bb Mon Sep 17 00:00:00 2001 From: Taeyoung Lee Date: Sat, 3 Aug 2024 16:28:39 +0000 Subject: [PATCH] Upload folder using huggingface_hub --- config.json | 6 +-- generation_config.json | 2 +- model-00001-of-00004.safetensors | 2 +- model-00002-of-00004.safetensors | 2 +- model-00003-of-00004.safetensors | 2 +- model-00004-of-00004.safetensors | 2 +- tokenizer.json | 67 ++++++++++++++++++++++++++++++-- tokenizer_config.json | 2 +- 8 files changed, 72 insertions(+), 13 deletions(-) diff --git a/config.json b/config.json index 7bb6ba6..256bb98 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "_name_or_path": "llama-8b-2", + "_name_or_path": "model-8b-3", "architectures": [ "LlamaForCausalLM" ], @@ -33,7 +33,7 @@ "rope_theta": 500000.0, "tie_word_embeddings": false, "torch_dtype": "bfloat16", - "transformers_version": "4.43.2", - "use_cache": true, + "transformers_version": "4.43.3", + "use_cache": false, "vocab_size": 128256 } diff --git a/generation_config.json b/generation_config.json index 9a3b3ce..2f6e1c3 100644 --- a/generation_config.json +++ b/generation_config.json @@ -8,5 +8,5 @@ ], "temperature": 0.6, "top_p": 0.9, - "transformers_version": "4.43.2" + "transformers_version": "4.43.3" } diff --git a/model-00001-of-00004.safetensors b/model-00001-of-00004.safetensors index b4db6cd..e49cb60 100644 --- a/model-00001-of-00004.safetensors +++ b/model-00001-of-00004.safetensors @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fb72fb5ddffe488d2c082b2a8e1c5da3ef88ddcbfe9ef4f0e6f4ab61c475049f +oid sha256:3d809e5791c77b11954b80cd94a0113c36368f660b2410c5e7eb04f7a7dd1d75 size 4976698672 diff --git a/model-00002-of-00004.safetensors b/model-00002-of-00004.safetensors index 98ae8f2..88ae281 100644 --- a/model-00002-of-00004.safetensors +++ b/model-00002-of-00004.safetensors @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1df06e82d669e107c869a7deeef463f3cecea4a3aca16a94bdfbd0c9e1ffe863 +oid sha256:44179899b26826cd73411efea6f2ff1ad1b9a0295c39a839ad94b155cdf446dc size 4999802720 diff --git a/model-00003-of-00004.safetensors b/model-00003-of-00004.safetensors index 358ad73..bd558bd 100644 --- a/model-00003-of-00004.safetensors +++ b/model-00003-of-00004.safetensors @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:57c79abaa42a7ec2cd18db4eeb0dcb0a5c1301586a781d30a41b23c6ca157068 +oid sha256:2d8193fc1d92c351727b196479a55d7210108615a815692586ad9d86d35fd40d size 4915916176 diff --git a/model-00004-of-00004.safetensors b/model-00004-of-00004.safetensors index b6aedd5..e962ca8 100644 --- a/model-00004-of-00004.safetensors +++ b/model-00004-of-00004.safetensors @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:74c6733b14ec63d1a54b4f48f836be5c594580ce40e71b4813345040d0aa4740 +oid sha256:1aa09030ae075f802bb7451399bbe1f074a155e80d01928121095e66ab927727 size 1168138808 diff --git a/tokenizer.json b/tokenizer.json index 4128065..5cc5f00 100644 --- a/tokenizer.json +++ b/tokenizer.json @@ -2329,10 +2329,69 @@ ] }, "post_processor": { - "type": "ByteLevel", - "add_prefix_space": true, - "trim_offsets": false, - "use_regex": true + "type": "Sequence", + "processors": [ + { + "type": "ByteLevel", + "add_prefix_space": true, + "trim_offsets": false, + "use_regex": true + }, + { + "type": "TemplateProcessing", + "single": [ + { + "SpecialToken": { + "id": "<|begin_of_text|>", + "type_id": 0 + } + }, + { + "Sequence": { + "id": "A", + "type_id": 0 + } + } + ], + "pair": [ + { + "SpecialToken": { + "id": "<|begin_of_text|>", + "type_id": 0 + } + }, + { + "Sequence": { + "id": "A", + "type_id": 0 + } + }, + { + "SpecialToken": { + "id": "<|begin_of_text|>", + "type_id": 1 + } + }, + { + "Sequence": { + "id": "B", + "type_id": 1 + } + } + ], + "special_tokens": { + "<|begin_of_text|>": { + "id": "<|begin_of_text|>", + "ids": [ + 128000 + ], + "tokens": [ + "<|begin_of_text|>" + ] + } + } + } + ] }, "decoder": { "type": "ByteLevel", diff --git a/tokenizer_config.json b/tokenizer_config.json index abb98a3..b6e4e4d 100644 --- a/tokenizer_config.json +++ b/tokenizer_config.json @@ -2050,7 +2050,7 @@ } }, "bos_token": "<|begin_of_text|>", - "chat_template": "{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{{ '<|start_header_id|>assistant<|end_header_id|>\n\n' }}", + "chat_template": "{{- bos_token }}\n{%- if custom_tools is defined %}\n {%- set tools = custom_tools %}\n{%- endif %}\n{%- if not tools_in_user_message is defined %}\n {%- set tools_in_user_message = true %}\n{%- endif %}\n{%- if not date_string is defined %}\n {%- set date_string = \"26 Jul 2024\" %}\n{%- endif %}\n{%- if not tools is defined %}\n {%- set tools = none %}\n{%- endif %}\n\n{#- This block extracts the system message, so we can slot it into the right place. #}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n{%- else %}\n {%- set system_message = \"\" %}\n{%- endif %}\n\n{#- System message + builtin tools #}\n{{- \"<|start_header_id|>system<|end_header_id|>\\n\\n\" }}\n{%- if builtin_tools is defined or tools is not none %}\n {{- \"Environment: ipython\\n\" }}\n{%- endif %}\n{%- if builtin_tools is defined %}\n {{- \"Tools: \" + builtin_tools | reject('equalto', 'code_interpreter') | join(\", \") + \"\\n\\n\"}}\n{%- endif %}\n{{- \"Cutting Knowledge Date: December 2023\\n\" }}\n{{- \"Today Date: \" + date_string + \"\\n\\n\" }}\n{%- if tools is not none and not tools_in_user_message %}\n {{- \"You have access to the following functions. To call a function, please respond with JSON for a function call.\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n{%- endif %}\n{{- system_message }}\n{{- \"<|eot_id|>\" }}\n\n{#- Custom tools are passed in a user message with some extra guidance #}\n{%- if tools_in_user_message and not tools is none %}\n {#- Extract the first user message so we can plug it in here #}\n {%- if messages | length != 0 %}\n {%- set first_user_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n {%- else %}\n {{- raise_exception(\"Cannot put tools in the first user message when there's no first user message!\") }}\n{%- endif %}\n {{- '<|start_header_id|>user<|end_header_id|>\\n\\n' -}}\n {{- \"Given the following functions, please respond with a JSON for a function call \" }}\n {{- \"with its proper arguments that best answers the given prompt.\\n\\n\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n {{- first_user_message + \"<|eot_id|>\"}}\n{%- endif %}\n\n{%- for message in messages %}\n {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\\n\\n'+ message['content'] | trim + '<|eot_id|>' }}\n {%- elif 'tool_calls' in message %}\n {%- if not message.tool_calls|length == 1 %}\n {{- raise_exception(\"This model only supports single tool-calls at once!\") }}\n {%- endif %}\n {%- set tool_call = message.tool_calls[0].function %}\n {%- if builtin_tools is defined and tool_call.name in builtin_tools %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- \"<|python_tag|>\" + tool_call.name + \".call(\" }}\n {%- for arg_name, arg_val in tool_call.arguments | items %}\n {{- arg_name + '=\"' + arg_val + '\"' }}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- endif %}\n {%- endfor %}\n {{- \")\" }}\n {%- else %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- '{\"name\": \"' + tool_call.name + '\", ' }}\n {{- '\"parameters\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- \"}\" }}\n {%- endif %}\n {%- if builtin_tools is defined %}\n {#- This means we're in ipython mode #}\n {{- \"<|eom_id|>\" }}\n {%- else %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n {%- elif message.role == \"tool\" or message.role == \"ipython\" %}\n {{- \"<|start_header_id|>ipython<|end_header_id|>\\n\\n\" }}\n {%- if message.content is mapping or message.content is iterable %}\n {{- message.content | tojson }}\n {%- else %}\n {{- message.content }}\n {%- endif %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' }}\n{%- endif %}\n", "clean_up_tokenization_spaces": true, "eos_token": "<|eot_id|>", "model_input_names": [