TheBloke commited on
Commit
92c365a
1 Parent(s): e802ac3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -0
README.md CHANGED
@@ -1,3 +1,76 @@
1
  ---
2
  license: other
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: other
3
  ---
4
+ # Koala: A Dialogue Model for Academic Research
5
+ This repo contains the weights of the Koala 13B model produced at Berkeley. It is the result of combining the diffs from https://huggingface.co/young-geng/koala with the original Llama 13B model.
6
+
7
+ This version has then been quantized to 4-bit using [GPTQ-for-LLaMa](https://github.com/qwopqwop200/GPTQ-for-LLaMa) and then converted to GGML for use with [llama.cpp](https://github.com/ggerganov/llama.cpp).
8
+
9
+ ## Other Koala repos
10
+
11
+ I have also made these other Koala models available:
12
+ * [Unquantized 13B model in HF format](https://huggingface.co/TheBloke/koala-13B-HF)
13
+ * [GPTQ quantized 4bit 7B model in `pt` and `safetensors` formats](https://huggingface.co/TheBloke/koala-7B-4bit-128g)
14
+ * [Unquantized 7B model in HF format](https://huggingface.co/TheBloke/koala-7B-HF)
15
+ * [Unquantized 7B model in GGML format for llama.cpp](https://huggingface.co/TheBloke/koala-7b-ggml-unquantized)
16
+
17
+ ## How to run in `llama.cpp`
18
+
19
+ I use the following command line; adjust for your tastes and needs:
20
+
21
+ ```
22
+ ./main -t 18 -m koala-13B-4bit-128g.GGML.bin --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "BEGINNING OF CONVERSATION:
23
+ USER: <PROMPT GOES HERE>
24
+ GPT:"
25
+ ```
26
+
27
+ Change `-t 18` to the number of physical CPU cores you have. For example if your system has 8 cores, 16 threads, use `-t 8`.
28
+
29
+ You will require 16GB or more RAM to run this model without swapping.
30
+
31
+ ## How the Koala delta weights were merged
32
+
33
+ The Koala delta weights were originally merged using the following commands, producing [koala-13B-HF](https://huggingface.co/TheBloke/koala-13B-HF):
34
+ ```
35
+ git clone https://github.com/young-geng/EasyLM
36
+
37
+ git clone https://huggingface.co/TheBloke/llama-13b
38
+
39
+ mkdir koala_diffs && cd koala_diffs && wget https://huggingface.co/young-geng/koala/resolve/main/koala_13b_diff_v2
40
+
41
+ cd EasyLM
42
+
43
+ PYTHON_PATH="${PWD}:$PYTHONPATH" python \
44
+ -m EasyLM.models.llama.convert_torch_to_easylm \
45
+ --checkpoint_dir=/content/llama-13b \
46
+ --output_file=/content/llama-13b-LM \
47
+ --streaming=True
48
+
49
+ PYTHON_PATH="${PWD}:$PYTHONPATH" python \
50
+ -m EasyLM.scripts.diff_checkpoint --recover_diff=True \
51
+ --load_base_checkpoint='params::/content/llama-13b-LM' \
52
+ --load_target_checkpoint='params::/content/koala_diffs/koala_13b_diff_v2' \
53
+ --output_file=/content/koala_13b.diff.weights \
54
+ --streaming=True
55
+
56
+ PYTHON_PATH="${PWD}:$PYTHONPATH" python \
57
+ -m EasyLM.models.llama.convert_easylm_to_hf --model_size=13b \
58
+ --output_dir=/content/koala-13B-HF \
59
+ --load_checkpoint='params::/content/koala_13b.diff.weights' \
60
+ --tokenizer_path=/content/llama-13b/tokenizer.model
61
+ ```
62
+
63
+ ## Further info
64
+
65
+ Check out the following links to learn more about the Berkeley Koala model.
66
+ * [Blog post](https://bair.berkeley.edu/blog/2023/04/03/koala/)
67
+ * [Online demo](https://koala.lmsys.org/)
68
+ * [EasyLM: training and serving framework on GitHub](https://github.com/young-geng/EasyLM)
69
+ * [Documentation for running Koala locally](https://github.com/young-geng/EasyLM/blob/main/docs/koala.md)
70
+
71
+ ## License
72
+ The model weights are intended for academic research only, subject to the
73
+ [model License of LLaMA](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md),
74
+ [Terms of Use of the data generated by OpenAI](https://openai.com/policies/terms-of-use),
75
+ and [Privacy Practices of ShareGPT](https://chrome.google.com/webstore/detail/sharegpt-share-your-chatg/daiacboceoaocpibfodeljbdfacokfjb).
76
+ Any other usage of the model weights, including but not limited to commercial usage, is strictly prohibited.