GGUF
andrijdavid commited on
Commit
4f85544
1 Parent(s): f618fb5

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +389 -0
README.md ADDED
@@ -0,0 +1,389 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ ---
4
+ license: other
5
+ tags:
6
+ - GGUF
7
+ license_name: apple-sample-code-license
8
+ license_link: LICENSE
9
+ quantized_by: andrijdavid
10
+ ---
11
+ # OpenELM-GGUF
12
+ - Original model: [OpenELM](https://huggingface.co/apple/OpenELM)
13
+
14
+ <!-- description start -->
15
+ ## Description
16
+
17
+ This repo contains GGUF format model files for [OpenELM](https://huggingface.co/apple/OpenELM).
18
+
19
+ <!-- description end -->
20
+ <!-- README_GGUF.md-about-gguf start -->
21
+ ### About GGUF
22
+ GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.
23
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
24
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). This is the source project for GGUF, providing both a Command Line Interface (CLI) and a server option.
25
+ * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), Known as the most widely used web UI, this project boasts numerous features and powerful extensions, and supports GPU acceleration.
26
+ * [Ollama](https://github.com/jmorganca/ollama) Ollama is a lightweight and extensible framework designed for building and running language models locally. It features a simple API for creating, managing, and executing models, along with a library of pre-built models for use in various applications​
27
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), A comprehensive web UI offering GPU acceleration across all platforms and architectures, particularly renowned for storytelling.
28
+ * [GPT4All](https://gpt4all.io), This is a free and open source GUI that runs locally, supporting Windows, Linux, and macOS with full GPU acceleration.
29
+ * [LM Studio](https://lmstudio.ai/) An intuitive and powerful local GUI for Windows and macOS (Silicon), featuring GPU acceleration.
30
+ * [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui). A notable web UI with a variety of unique features, including a comprehensive model library for easy model selection.
31
+ * [Faraday.dev](https://faraday.dev/), An attractive, user-friendly character-based chat GUI for Windows and macOS (both Silicon and Intel), also offering GPU acceleration.
32
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), A Python library equipped with GPU acceleration, LangChain support, and an OpenAI-compatible API server.
33
+ * [candle](https://github.com/huggingface/candle), A Rust-based ML framework focusing on performance, including GPU support, and designed for ease of use.
34
+ * [ctransformers](https://github.com/marella/ctransformers), A Python library featuring GPU acceleration, LangChain support, and an OpenAI-compatible AI server.
35
+ * [localGPT](https://github.com/PromtEngineer/localGPT) An open-source initiative enabling private conversations with documents.
36
+ <!-- README_GGUF.md-about-gguf end -->
37
+
38
+ <!-- compatibility_gguf start -->
39
+ ## Explanation of quantisation methods
40
+ <details>
41
+ <summary>Click to see details</summary>
42
+ The new methods available are:
43
+
44
+ * GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
45
+ * GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
46
+ * GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
47
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
48
+ * GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw.
49
+ </details>
50
+ <!-- compatibility_gguf end -->
51
+
52
+ <!-- README_GGUF.md-how-to-download start -->
53
+ ## How to download GGUF files
54
+
55
+ **Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single folder.
56
+
57
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
58
+
59
+ * LM Studio
60
+ * LoLLMS Web UI
61
+ * Faraday.dev
62
+
63
+ ### In `text-generation-webui`
64
+
65
+ Under Download Model, you can enter the model repo: LiteLLMs/OpenELM-GGUF and below it, a specific filename to download, such as: Q4_0/Q4_0-00001-of-00009.gguf.
66
+
67
+ Then click Download.
68
+
69
+ ### On the command line, including multiple files at once
70
+
71
+ I recommend using the `huggingface-hub` Python library:
72
+
73
+ ```shell
74
+ pip3 install huggingface-hub
75
+ ```
76
+
77
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
78
+
79
+ ```shell
80
+ huggingface-cli download LiteLLMs/OpenELM-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
81
+ ```
82
+
83
+ <details>
84
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
85
+
86
+ You can also download multiple files at once with a pattern:
87
+
88
+ ```shell
89
+ huggingface-cli download LiteLLMs/OpenELM-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
90
+ ```
91
+
92
+ For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
93
+
94
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
95
+
96
+ ```shell
97
+ pip3 install huggingface_hub[hf_transfer]
98
+ ```
99
+
100
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
101
+
102
+ ```shell
103
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download LiteLLMs/OpenELM-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
104
+ ```
105
+
106
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
107
+ </details>
108
+ <!-- README_GGUF.md-how-to-download end -->
109
+ <!-- README_GGUF.md-how-to-run start -->
110
+ ## Example `llama.cpp` command
111
+
112
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
113
+
114
+ ```shell
115
+ ./main -ngl 35 -m Q4_0/Q4_0-00001-of-00009.gguf --color -c 8192 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<PROMPT>"
116
+ ```
117
+
118
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
119
+
120
+ Change `-c 8192` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically. Note that longer sequence lengths require much more resources, so you may need to reduce this value.
121
+
122
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
123
+
124
+ For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
125
+
126
+ ## How to run in `text-generation-webui`
127
+
128
+ Further instructions can be found in the text-generation-webui documentation, here: [text-generation-webui/docs/04 ‐ Model Tab.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/04%20%E2%80%90%20Model%20Tab.md#llamacpp).
129
+
130
+ ## How to run from Python code
131
+
132
+ You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries. Note that at the time of writing (Nov 27th 2023), ctransformers has not been updated for some time and is not compatible with some recent models. Therefore I recommend you use llama-cpp-python.
133
+
134
+ ### How to load this model in Python code, using llama-cpp-python
135
+
136
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
137
+
138
+ #### First install the package
139
+
140
+ Run one of the following commands, according to your system:
141
+
142
+ ```shell
143
+ # Base ctransformers with no GPU acceleration
144
+ pip install llama-cpp-python
145
+ # With NVidia CUDA acceleration
146
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
147
+ # Or with OpenBLAS acceleration
148
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
149
+ # Or with CLBLast acceleration
150
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
151
+ # Or with AMD ROCm GPU acceleration (Linux only)
152
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
153
+ # Or with Metal GPU acceleration for macOS systems only
154
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
155
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
156
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
157
+ pip install llama-cpp-python
158
+ ```
159
+
160
+ #### Simple llama-cpp-python example code
161
+
162
+ ```python
163
+ from llama_cpp import Llama
164
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
165
+ llm = Llama(
166
+ model_path="./Q4_0/Q4_0-00001-of-00009.gguf", # Download the model file first
167
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
168
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
169
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
170
+ )
171
+ # Simple inference example
172
+ output = llm(
173
+ "<PROMPT>", # Prompt
174
+ max_tokens=512, # Generate up to 512 tokens
175
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
176
+ echo=True # Whether to echo the prompt
177
+ )
178
+ # Chat Completion API
179
+ llm = Llama(model_path="./Q4_0/Q4_0-00001-of-00009.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
180
+ llm.create_chat_completion(
181
+ messages = [
182
+ {"role": "system", "content": "You are a story writing assistant."},
183
+ {
184
+ "role": "user",
185
+ "content": "Write a story about llamas."
186
+ }
187
+ ]
188
+ )
189
+ ```
190
+
191
+ ## How to use with LangChain
192
+
193
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
194
+
195
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
196
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
197
+
198
+ <!-- README_GGUF.md-how-to-run end -->
199
+
200
+ <!-- footer end -->
201
+
202
+ <!-- original-model-card start -->
203
+ # Original model card: OpenELM
204
+
205
+
206
+ # OpenELM: An Efficient Language Model Family with Open-source Training and Inference Framework
207
+
208
+ *Sachin Mehta, Mohammad Hossein Sekhavat, Qingqing Cao, Maxwell Horton, Yanzi Jin, Chenfan Sun, Iman Mirzadeh, Mahyar Najibi, Dmitry Belenko, Peter Zatloukal, Mohammad Rastegari*
209
+
210
+ We introduce **OpenELM**, a family of **Open**-source **E**fficient **L**anguage **M**odels. OpenELM uses a layer-wise scaling strategy to efficiently allocate parameters within each layer of the transformer model, leading to enhanced accuracy. We pretrained OpenELM models using the [CoreNet](https://github.com/apple/corenet) library. We release both pretrained and instruction tuned models with 270M, 450M, 1.1B and 3B parameters.
211
+
212
+ Our pre-training dataset contains RefinedWeb, deduplicated PILE, a subset of RedPajama, and a subset of Dolma v1.6, totaling approximately 1.8 trillion tokens. Please check license agreements and terms of these datasets before using them.
213
+
214
+ See the list below for the details of each model:
215
+
216
+ - [OpenELM-270M](https://huggingface.co/apple/OpenELM-270M)
217
+ - [OpenELM-450M](https://huggingface.co/apple/OpenELM-450M)
218
+ - [OpenELM-1_1B](https://huggingface.co/apple/OpenELM-1_1B)
219
+ - [OpenELM-3B](https://huggingface.co/apple/OpenELM-3B)
220
+ - [OpenELM-270M-Instruct](https://huggingface.co/apple/OpenELM-270M-Instruct)
221
+ - [OpenELM-450M-Instruct](https://huggingface.co/apple/OpenELM-450M-Instruct)
222
+ - [OpenELM-1_1B-Instruct](https://huggingface.co/apple/OpenELM-1_1B-Instruct)
223
+ - [OpenELM-3B-Instruct](https://huggingface.co/apple/OpenELM-3B-Instruct)
224
+
225
+ ```python
226
+
227
+ from transformers import AutoModelForCausalLM
228
+
229
+ openelm_270m = AutoModelForCausalLM.from_pretrained("apple/OpenELM-270M", trust_remote_code=True)
230
+ openelm_450m = AutoModelForCausalLM.from_pretrained("apple/OpenELM-450M", trust_remote_code=True)
231
+ openelm_1b = AutoModelForCausalLM.from_pretrained("apple/OpenELM-1_1B", trust_remote_code=True)
232
+ openelm_3b = AutoModelForCausalLM.from_pretrained("apple/OpenELM-3B", trust_remote_code=True)
233
+
234
+ openelm_270m_instruct = AutoModelForCausalLM.from_pretrained("apple/OpenELM-270M-Instruct", trust_remote_code=True)
235
+ openelm_450m_instruct = AutoModelForCausalLM.from_pretrained("apple/OpenELM-450M-Instruct", trust_remote_code=True)
236
+ openelm_1b_instruct = AutoModelForCausalLM.from_pretrained("apple/OpenELM-1_1B-Instruct", trust_remote_code=True)
237
+ openelm_3b_instruct = AutoModelForCausalLM.from_pretrained("apple/OpenELM-3B-Instruct", trust_remote_code=True)
238
+
239
+ ```
240
+
241
+ ## Usage
242
+
243
+ We have provided an example function to generate output from OpenELM models loaded via [HuggingFace Hub](https://huggingface.co/docs/hub/) in `generate_openelm.py`.
244
+
245
+ You can try the model by running the following command:
246
+ ```
247
+ python generate_openelm.py --model [MODEL_NAME] --hf_access_token [HF_ACCESS_TOKEN] --prompt 'Once upon a time there was' --generate_kwargs repetition_penalty=1.2
248
+ ```
249
+ Please refer to [this link](https://huggingface.co/docs/hub/security-tokens) to obtain your hugging face access token.
250
+
251
+ Additional arguments to the hugging face generate function can be passed via `generate_kwargs`. As an example, to speedup the inference, you can try [lookup token speculative generation](https://huggingface.co/docs/transformers/generation_strategies) by passing the `prompt_lookup_num_tokens` argument as follows:
252
+ ```
253
+ python generate_openelm.py --model [MODEL_NAME] --hf_access_token [HF_ACCESS_TOKEN] --prompt 'Once upon a time there was' --generate_kwargs repetition_penalty=1.2 prompt_lookup_num_tokens=10
254
+ ```
255
+ Alternatively, try model-wise speculative generation with an [assistive model](https://huggingface.co/blog/assisted-generation) by passing a smaller model through the `assistant_model` argument, for example:
256
+ ```
257
+ python generate_openelm.py --model [MODEL_NAME] --hf_access_token [HF_ACCESS_TOKEN] --prompt 'Once upon a time there was' --generate_kwargs repetition_penalty=1.2 --assistant_model [SMALLER_MODEL_NAME]
258
+ ```
259
+
260
+
261
+ ## Main Results
262
+
263
+ ### Zero-Shot
264
+
265
+ | **Model Size** | **ARC-c** | **ARC-e** | **BoolQ** | **HellaSwag** | **PIQA** | **SciQ** | **WinoGrande** | **Average** |
266
+ | | | - | | -- | | | -- | -- | | | - | | -- |
267
+ | [OpenELM-270M](https://huggingface.co/apple/OpenELM-270M) | 27.65 | **66.79** | 47.15 | 25.72 | 69.75 | 30.91 | **39.24** | **53.83** | 45.13 |
268
+ | [OpenELM-270M-Instruct](https://huggingface.co/apple/OpenELM-270M-Instruct) | **32.51** | 66.01 | **51.58** | **26.70** | **70.78** | 33.78 | 38.72 | 53.20 | **46.66** |
269
+ | [OpenELM-450M](https://huggingface.co/apple/OpenELM-450M) | 30.20 | **68.63** | 53.86 | **26.01** | 72.31 | 33.11 | 40.18 | 57.22 | 47.69 |
270
+ | [OpenELM-450M-Instruct](https://huggingface.co/apple/OpenELM-450M-Instruct) | **33.53** | 67.44 | **59.31** | 25.41 | **72.63** | **36.84** | **40.48** | **58.33** | **49.25** |
271
+ | [OpenELM-1_1B](https://huggingface.co/apple/OpenELM-1_1B) | 36.69 | **71.74** | 65.71 | **27.05** | **75.57** | 36.46 | 36.98 | 63.22 | 51.68 |
272
+ | [OpenELM-1_1B-Instruct](https://huggingface.co/apple/OpenELM-1_1B-Instruct) | **41.55** | 71.02 | **71.83** | 25.65 | 75.03 | **39.43** | **45.95** | **64.72** | **54.40** |
273
+ | [OpenELM-3B](https://huggingface.co/apple/OpenELM-3B) | 42.24 | **73.29** | 73.28 | **26.76** | 78.24 | **38.76** | 34.98 | 67.25 | 54.35 |
274
+ | [OpenELM-3B-Instruct](https://huggingface.co/apple/OpenELM-3B-Instruct) | **47.70** | 72.33 | **76.87** | 24.80 | **79.00** | 38.47 | **38.76** | **67.96** | **55.73** |
275
+
276
+ See the technical report for more results and comparison.
277
+
278
+ ## Evaluation
279
+
280
+ ### Setup
281
+
282
+ Install the following dependencies:
283
+
284
+ ```bash
285
+
286
+ # install public lm-eval-harness
287
+
288
+ harness_repo="public-lm-eval-harness"
289
+ git clone https://github.com/EleutherAI/lm-evaluation-harness ${harness_repo}
290
+ cd ${harness_repo}
291
+ # use main branch on 03-15-2024, SHA is dc90fec
292
+ git checkout dc90fec
293
+ pip install -e .
294
+ cd ..
295
+
296
+ # 66d6242 is the main branch on 2024-04-01
297
+ pip install datasets@git+https://github.com/huggingface/datasets.git@66d6242
298
+ pip install tokenizers>=0.15.2 transformers>=4.38.2 sentencepiece>=0.2.0
299
+
300
+ ```
301
+
302
+ ### Evaluate OpenELM
303
+
304
+ ```bash
305
+
306
+ # OpenELM-270M
307
+ hf_model=OpenELM-270M
308
+
309
+ # this flag is needed because lm-eval-harness set add_bos_token to False by default, but OpenELM uses LLaMA tokenizer which requires add_bos_token to be True
310
+ tokenizer=meta-llama/Llama-2-7b-hf
311
+ add_bos_token=True
312
+ batch_size=1
313
+
314
+ mkdir lm_eval_output
315
+
316
+ shot=0
317
+ task=arc_challenge,arc_easy,boolq,hellaswag,piqa,race,winogrande,sciq,truthfulqa_mc2
318
+ lm_eval --model hf \
319
+ --model_args pretrained=${hf_model},trust_remote_code=True,add_bos_token=${add_bos_token},tokenizer=${tokenizer} \
320
+ --tasks ${task} \
321
+ --device cuda:0 \
322
+ --num_fewshot ${shot} \
323
+ --output_path ./lm_eval_output/${hf_model//\//_}_${task//,/_}-${shot}shot \
324
+ --batch_size ${batch_size} 2>&1 | tee ./lm_eval_output/eval-${hf_model//\//_}_${task//,/_}-${shot}shot.log
325
+
326
+ shot=5
327
+ task=mmlu,winogrande
328
+ lm_eval --model hf \
329
+ --model_args pretrained=${hf_model},trust_remote_code=True,add_bos_token=${add_bos_token},tokenizer=${tokenizer} \
330
+ --tasks ${task} \
331
+ --device cuda:0 \
332
+ --num_fewshot ${shot} \
333
+ --output_path ./lm_eval_output/${hf_model//\//_}_${task//,/_}-${shot}shot \
334
+ --batch_size ${batch_size} 2>&1 | tee ./lm_eval_output/eval-${hf_model//\//_}_${task//,/_}-${shot}shot.log
335
+
336
+ shot=25
337
+ task=arc_challenge,crows_pairs_english
338
+ lm_eval --model hf \
339
+ --model_args pretrained=${hf_model},trust_remote_code=True,add_bos_token=${add_bos_token},tokenizer=${tokenizer} \
340
+ --tasks ${task} \
341
+ --device cuda:0 \
342
+ --num_fewshot ${shot} \
343
+ --output_path ./lm_eval_output/${hf_model//\//_}_${task//,/_}-${shot}shot \
344
+ --batch_size ${batch_size} 2>&1 | tee ./lm_eval_output/eval-${hf_model//\//_}_${task//,/_}-${shot}shot.log
345
+
346
+ shot=10
347
+ task=hellaswag
348
+ lm_eval --model hf \
349
+ --model_args pretrained=${hf_model},trust_remote_code=True,add_bos_token=${add_bos_token},tokenizer=${tokenizer} \
350
+ --tasks ${task} \
351
+ --device cuda:0 \
352
+ --num_fewshot ${shot} \
353
+ --output_path ./lm_eval_output/${hf_model//\//_}_${task//,/_}-${shot}shot \
354
+ --batch_size ${batch_size} 2>&1 | tee ./lm_eval_output/eval-${hf_model//\//_}_${task//,/_}-${shot}shot.log
355
+
356
+ ```
357
+
358
+
359
+ ## Bias, Risks, and Limitations
360
+
361
+ The release of OpenELM models aims to empower and enrich the open research community by providing access to state-of-the-art language models. Trained on publicly available datasets, these models are made available without any safety guarantees. Consequently, there exists the possibility of these models producing outputs that are inaccurate, harmful, biased, or objectionable in response to user prompts. Thus, it is imperative for users and developers to undertake thorough safety testing and implement appropriate filtering mechanisms tailored to their specific requirements.
362
+
363
+ ## Citation
364
+
365
+ If you find our work useful, please cite:
366
+
367
+ ```BibTex
368
+ @article{mehtaOpenELMEfficientLanguage2024,
369
+ title = {{OpenELM}: {An} {Efficient} {Language} {Model} {Family} with {Open}-source {Training} and {Inference} {Framework}},
370
+ shorttitle = {{OpenELM}},
371
+ url = {https://arxiv.org/abs/2404.14619v1},
372
+ language = {en},
373
+ urldate = {2024-04-24},
374
+ journal = {arXiv.org},
375
+ author = {Mehta, Sachin and Sekhavat, Mohammad Hossein and Cao, Qingqing and Horton, Maxwell and Jin, Yanzi and Sun, Chenfan and Mirzadeh, Iman and Najibi, Mahyar and Belenko, Dmitry and Zatloukal, Peter and Rastegari, Mohammad},
376
+ month = apr,
377
+ year = {2024},
378
+ }
379
+
380
+ @inproceedings{mehta2022cvnets,
381
+ author = {Mehta, Sachin and Abdolhosseini, Farzad and Rastegari, Mohammad},
382
+ title = {CVNets: High Performance Library for Computer Vision},
383
+ year = {2022},
384
+ booktitle = {Proceedings of the 30th ACM International Conference on Multimedia},
385
+ series = {MM '22}
386
+ }
387
+ ```
388
+
389
+ <!-- original-model-card end -->