mofosyne commited on
Commit
224e4ef
1 Parent(s): 2e0a76e

test new proposed outfile naming convention changes to llama.cpp conversion script

Browse files
.args CHANGED
@@ -1,2 +1,2 @@
1
  -m
2
- TinyLLama-v0.1-5M-F16.gguf
 
1
  -m
2
+ Tinyllama-5M-v0.2-F16.gguf
.gitmodules CHANGED
@@ -1,9 +1,9 @@
1
  [submodule "maykeye_tinyllama"]
2
  path = maykeye_tinyllama
3
  url = https://huggingface.co/Maykeye/TinyLLama-v0
4
- [submodule "llama.cpp"]
5
- path = llama.cpp
6
- url = git@github.com:ggerganov/llama.cpp.git
7
  [submodule "llamafile"]
8
  path = llamafile
9
  url = git@github.com:Mozilla-Ocho/llamafile.git
 
 
 
 
1
  [submodule "maykeye_tinyllama"]
2
  path = maykeye_tinyllama
3
  url = https://huggingface.co/Maykeye/TinyLLama-v0
 
 
 
4
  [submodule "llamafile"]
5
  path = llamafile
6
  url = git@github.com:Mozilla-Ocho/llamafile.git
7
+ [submodule "llama.cpp"]
8
+ path = llama.cpp
9
+ url = git@github.com:mofosyne/llama.cpp.git
TinyLLama-v0.1-5M-F16.gguf → Tinyllama-5M-v0.2-F16.gguf RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c0425ad47400ab633ed323cb6b64c84d7f1369c8f5c69108136f4fcef2ddee43
3
- size 10008160
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0422a7e84b0d8a6ebc77513ec4fe53979850b9f6235265eba76e3e954072f86
3
+ size 10008256
TinyLLama-v0.1-5M-F16.llamafile → Tinyllama-5M-v0.2-F16.llamafile RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:eb08aa9d2d3a6850648ade72885a39abf5b8aac8450a8b05ffccbaa96c4080d3
3
- size 18560831
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0098e4ca8bbf84474fc65105d9149047d73ad964481182b954efae4ab5a9bfe9
3
+ size 19281727
llama.cpp CHANGED
@@ -1 +1 @@
1
- Subproject commit b1f8af1886e8187db6bb2a9b87cfc1c0f175f629
 
1
+ Subproject commit 00ff73a90101c76108131a5867a3c3c78a42ee8c
llamafile CHANGED
@@ -1 +1 @@
1
- Subproject commit d4099feff737f3be9a4bed017f1315a4d2cb773a
 
1
+ Subproject commit 9cd8d70942a049ba3c3bddd12e87e1fb599fbd49
llamafile-creation-legacy.sh ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ MODEL_DIR="maykeye_tinyllama"
4
+ METADATA_FILE="maykeye_tinyllama-metadata.json"
5
+
6
+ ###############################################################################
7
+ # Pull both model folder, llamafile (for the engine) and llama.cpp (for the conversion script)
8
+ echo == Prep Enviroment ==
9
+ git submodule update --init
10
+
11
+ ###############################################################################
12
+ echo == Build and prep the llamafile engine execuable ==
13
+ pushd llamafile
14
+ make -j8
15
+ make
16
+ # This is where each executables is located for reference purpose for now as of 2024-04-05
17
+ # and was determined by running `sudo make install PREFIX=/usr/local`
18
+ # ./o/llamafile/zipalign --> /usr/local/bin/zipalign
19
+ # ./o/llama.cpp/main/main --> /usr/local/bin/llamafile
20
+ # ./o/llama.cpp/imatrix/imatrix --> /usr/local/bin/llamafile-imatrix
21
+ # ./o/llama.cpp/quantize/quantize --> /usr/local/bin/llamafile-quantize
22
+ # ./build/llamafile-convert --> /usr/local/bin/llamafile-convert
23
+ # ./o/llama.cpp/perplexity/perplexity --> /usr/local/bin/llamafile-perplexity
24
+ # ./o/llama.cpp/llava/llava-quantize --> /usr/local/bin/llava-quantize
25
+ popd
26
+
27
+ ###############################################################################
28
+ echo == What is our llamafile name going to be? ==
29
+ OUTFILE=$(./llama.cpp/examples/convert-legacy-llama.py ${MODEL_DIR} --metadata ${METADATA_FILE} --outtype f16 --get-outfile)
30
+ echo We will be aiming to generate $OUTFILE.llamafile
31
+
32
+ ###############################################################################
33
+ echo == Convert from safetensor to gguf ==
34
+ ./llama.cpp/examples/convert-legacy-llama.py ${MODEL_DIR} --metadata ${METADATA_FILE} --outtype f16
35
+ mv ${MODEL_DIR}/${OUTFILE}.gguf ${OUTFILE}.gguf
36
+
37
+ ###############################################################################
38
+ echo == Generating Llamafile ==
39
+ cp ./llamafile/o/llama.cpp/main/main ${OUTFILE}.llamafile
40
+
41
+ # Create an .args file with settings defaults
42
+ cat >.args <<EOF
43
+ -m
44
+ ${OUTFILE}.gguf
45
+ EOF
46
+
47
+ # zip align engine, gguf and default args
48
+ ./llamafile/o/llamafile/zipalign -j0 ${OUTFILE}.llamafile ${OUTFILE}.gguf .args
49
+
50
+ ###############################################################################
51
+ echo == Test Output ==
52
+ ./${OUTFILE}.llamafile --cli -p "hello world the gruff man said"
llamafile-creation.sh CHANGED
@@ -26,12 +26,12 @@ popd
26
 
27
  ###############################################################################
28
  echo == What is our llamafile name going to be? ==
29
- OUTFILE=$(./llama.cpp/convert.py ${MODEL_DIR} --metadata ${METADATA_FILE} --outtype f16 --get-outfile)
30
  echo We will be aiming to generate $OUTFILE.llamafile
31
 
32
  ###############################################################################
33
  echo == Convert from safetensor to gguf ==
34
- ./llama.cpp/convert.py ${MODEL_DIR} --metadata ${METADATA_FILE} --outtype f16
35
  mv ${MODEL_DIR}/${OUTFILE}.gguf ${OUTFILE}.gguf
36
 
37
  ###############################################################################
 
26
 
27
  ###############################################################################
28
  echo == What is our llamafile name going to be? ==
29
+ OUTFILE=$(./llama.cpp/convert-hf-to-gguf.py ${MODEL_DIR} --metadata ${METADATA_FILE} --outtype f16 --get-outfile)
30
  echo We will be aiming to generate $OUTFILE.llamafile
31
 
32
  ###############################################################################
33
  echo == Convert from safetensor to gguf ==
34
+ ./llama.cpp/convert-hf-to-gguf.py ${MODEL_DIR} --metadata ${METADATA_FILE} --outtype f16 --verbose
35
  mv ${MODEL_DIR}/${OUTFILE}.gguf ${OUTFILE}.gguf
36
 
37
  ###############################################################################
maykeye_tinyllama-metadata.json CHANGED
@@ -1,10 +1,10 @@
1
  {
2
  "general.name": "TinyLLama",
3
- "general.version": "v0.1",
4
  "general.author": "mofosyne",
5
  "general.url": "https://huggingface.co/mofosyne/TinyLLama-v0-llamafile",
6
  "general.description": "This gguf is ported from a first version of Maykeye attempt at recreating roneneldan/TinyStories-1M but using Llama architecture",
7
  "general.license": "apache-2.0",
8
  "general.source.url": "https://huggingface.co/Maykeye/TinyLLama-v0",
9
- "general.source.huggingface.repository": "https://huggingface.co/Maykeye/TinyLLama-v0"
10
  }
 
1
  {
2
  "general.name": "TinyLLama",
3
+ "general.version": "v0.2",
4
  "general.author": "mofosyne",
5
  "general.url": "https://huggingface.co/mofosyne/TinyLLama-v0-llamafile",
6
  "general.description": "This gguf is ported from a first version of Maykeye attempt at recreating roneneldan/TinyStories-1M but using Llama architecture",
7
  "general.license": "apache-2.0",
8
  "general.source.url": "https://huggingface.co/Maykeye/TinyLLama-v0",
9
+ "general.source.huggingface.repository": "Maykeye/TinyLLama-v0"
10
  }