prince-canuma commited on
Commit
7add8e4
1 Parent(s): 4ef7b77

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,4 +1,5 @@
1
  ---
 
2
  language:
3
  - en
4
  - de
@@ -8,8 +9,9 @@ language:
8
  - hi
9
  - es
10
  - th
11
- license: llama3.1
12
  library_name: transformers
 
 
13
  tags:
14
  - facebook
15
  - meta
@@ -17,7 +19,6 @@ tags:
17
  - llama
18
  - llama-3
19
  - mlx
20
- pipeline_tag: text-generation
21
  extra_gated_prompt: "### LLAMA 3.1 COMMUNITY LICENSE AGREEMENT\nLlama 3.1 Version\
22
  \ Release Date: July 23, 2024\n\"Agreement\" means the terms and conditions for\
23
  \ use, reproduction, distribution and modification of the Llama Materials set forth\
@@ -190,9 +191,9 @@ extra_gated_description: The information you provide will be collected, stored,
190
  extra_gated_button_content: Submit
191
  ---
192
 
193
- # mlx-community/Meta-Llama-3.1-70B-Instruct-bf16
194
 
195
- The Model [mlx-community/Meta-Llama-3.1-70B-Instruct-bf16](https://huggingface.co/mlx-community/Meta-Llama-3.1-70B-Instruct-bf16) was converted to MLX format from [meta-llama/Meta-Llama-3.1-70B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-70B-Instruct) using mlx-lm version **0.16.0**.
196
 
197
  ## Use with mlx
198
 
@@ -203,6 +204,15 @@ pip install mlx-lm
203
  ```python
204
  from mlx_lm import load, generate
205
 
206
- model, tokenizer = load("mlx-community/Meta-Llama-3.1-70B-Instruct-bf16")
207
- response = generate(model, tokenizer, prompt="hello", verbose=True)
 
 
 
 
 
 
 
 
 
208
  ```
 
1
  ---
2
+ base_model: meta-llama/Llama-3.1-70B-Instruct
3
  language:
4
  - en
5
  - de
 
9
  - hi
10
  - es
11
  - th
 
12
  library_name: transformers
13
+ license: llama3.1
14
+ pipeline_tag: text-generation
15
  tags:
16
  - facebook
17
  - meta
 
19
  - llama
20
  - llama-3
21
  - mlx
 
22
  extra_gated_prompt: "### LLAMA 3.1 COMMUNITY LICENSE AGREEMENT\nLlama 3.1 Version\
23
  \ Release Date: July 23, 2024\n\"Agreement\" means the terms and conditions for\
24
  \ use, reproduction, distribution and modification of the Llama Materials set forth\
 
191
  extra_gated_button_content: Submit
192
  ---
193
 
194
+ # mlx-community/Llama-3.1-70B-Instruct-bf16
195
 
196
+ The Model [mlx-community/Llama-3.1-70B-Instruct-bf16](https://huggingface.co/mlx-community/Llama-3.1-70B-Instruct-bf16) was converted to MLX format from [meta-llama/Llama-3.1-70B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct) using mlx-lm version **0.19.0**.
197
 
198
  ## Use with mlx
199
 
 
204
  ```python
205
  from mlx_lm import load, generate
206
 
207
+ model, tokenizer = load("mlx-community/Llama-3.1-70B-Instruct-bf16")
208
+
209
+ prompt="hello"
210
+
211
+ if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
212
+ messages = [{"role": "user", "content": prompt}]
213
+ prompt = tokenizer.apply_chat_template(
214
+ messages, tokenize=False, add_generation_prompt=True
215
+ )
216
+
217
+ response = generate(model, tokenizer, prompt=prompt, verbose=True)
218
  ```
config.json CHANGED
@@ -21,10 +21,6 @@
21
  "num_hidden_layers": 80,
22
  "num_key_value_heads": 8,
23
  "pretraining_tp": 1,
24
- "quantization": {
25
- "group_size": 64,
26
- "bits": 4
27
- },
28
  "rms_norm_eps": 1e-05,
29
  "rope_scaling": {
30
  "factor": 8.0,
 
21
  "num_hidden_layers": 80,
22
  "num_key_value_heads": 8,
23
  "pretraining_tp": 1,
 
 
 
 
24
  "rms_norm_eps": 1e-05,
25
  "rope_scaling": {
26
  "factor": 8.0,
model-00001-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d021236afe2ee2cbae53afe2ed2f92ad1cbaf2dd63f16b3eb37295486920f492
3
+ size 5054170964
model-00002-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eed05974f72d2b7aaf65985c6b793291703e2c2212d0cf409f41f3c4805f68fc
3
+ size 5133929554
model-00003-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:753bb69c38eb055be27537749517990be65736f6762cef66084f467ab65a1e4a
3
+ size 5133929550
model-00004-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ddd34b6c86a0616363d6aee6a24bf7c78f76aef3edef9a162928f4b530b11ea7
3
+ size 5133929560
model-00005-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5be4b843d1f59fb008e40ef760c8157801bb55ef0d75a02501cb276d1ba6fd5e
3
+ size 5133929559
model-00006-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:567c7a66c7a8b0c25b9f021f47d6de00f115eb23a38fe06f4ff74a71943beadd
3
+ size 5133929575
model-00007-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e52d6d4122b7c392bbdd5390573ae8e3cf8ed63770ea79a7f133617f3272b7a3
3
+ size 5133929573
model-00008-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db7cfc59bc1b8804c161f7246fdf1381615c0997be1aa9fe2905d0f99185fa69
3
+ size 5133929575
model-00009-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16a911e7e142526bd9a6c3f07b6f9527377375d6c39620cedb492d166eb8dde2
3
+ size 5133929575
model-00010-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e962ac031f21d18f6c0d26857a2bf1699dfd97a303ebdf8068a9891a3f2dd8b4
3
+ size 5133929577
model-00011-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9271be51d9cae5a05c8ec488610760ffb5bd23bd8cfb97d89fd55d1fe1a9db9
3
+ size 5133929581
model-00012-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23f2e41a31784609f1f73118f3f62f4e96f7ebe34fd7525209a7e4f3ce431237
3
+ size 5133929571
model-00013-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:497af4734d0814bd64ca49e22a54711fd4f294bd3a17c7b53e7828ebe047c8f9
3
+ size 5133929575
model-00014-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:acbd40f3e709b21370e722dbde04676af034e3f064304a2ed11c0cf5675de2f6
3
+ size 5133929575
model-00015-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea4771a280097987ab2383be60fcc096a2c1cf62ad73c9f675d1712265d5f88f
3
+ size 5133929551
model-00016-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a862ec22ac0aca19c8ed3dbba0e0400aa41343d63ca10ed3e3dfec1778f9a39
3
+ size 5133929573
model-00017-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02e27347195c3a5c5afe74364bfa22182ce6758fa3081aaf705a89292a349cb0
3
+ size 5133929573
model-00018-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33a4939e2281cf708f0fb2f8e9d51c8b0cd5ac754796edc5eedaa22f3d9ffe92
3
+ size 5133929573
model-00019-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8762f3dd94df9aba2fc754098a2fe58982460b18d51b1eca1afbb5e9ca71f711
3
+ size 5133929569
model-00020-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84153b307de54bde435202d861dbf801beee6b63c87f5d6e72e82eea119f71ef
3
+ size 5133929575
model-00021-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93d3fc83c08d2403b06a7449df0ff8c28a97e1e6ce9b757bf53d9ce2f676fae6
3
+ size 5133929577
model-00022-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f0c2c54af7e90b304a24f5c0da590d20c58dec3bc94e06644c66e7f7e776c33
3
+ size 5133929575
model-00023-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e581332c397a75cf6612a85d78b8696fe34abbaadcbeabbcafcc6f782b24a0e
3
+ size 5133929579
model-00024-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2b6e65a40c18fa5780d9c4cdab5c086a1bf52b7931bf6a96beb57f43bb4b156
3
+ size 5133929573
model-00025-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fc5f958cc9422b0cb7233d7d5dd4f028286cfa68afd30eb11c9c0c9c66bc4b2
3
+ size 5133929581
model-00026-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e72a0295085a1aa891592de5228259d6ae814a7f43fc94ee9a683dcc5af13f15
3
+ size 5133929577
model-00027-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf4594e861a6073dbafc23d604e45ad2a13d40e321d7fd7a5e8b07b78f19918f
3
+ size 5133929573
model-00028-of-00028.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:782616cea50ad052c77921fe4583acfe388f32b4d108cb1f4ad49fecd876fd3d
3
+ size 2571158069
model.safetensors.index.json CHANGED
The diff for this file is too large to render. See raw diff
 
tokenizer.json CHANGED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json CHANGED
@@ -2050,7 +2050,7 @@
2050
  }
2051
  },
2052
  "bos_token": "<|begin_of_text|>",
2053
- "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' }}",
2054
  "clean_up_tokenization_spaces": true,
2055
  "eos_token": "<|eot_id|>",
2056
  "model_input_names": [
 
2050
  }
2051
  },
2052
  "bos_token": "<|begin_of_text|>",
2053
+ "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",
2054
  "clean_up_tokenization_spaces": true,
2055
  "eos_token": "<|eot_id|>",
2056
  "model_input_names": [