Download conversion/codeshell.py from Brunobkr/llama.cpp_AlgMor24_github: direct link, hf CLI and curl.
- Browser
- Download file 973 Bytes
-
https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github/resolve/9f63da05cd17e144eb118af61a784286378961ba/conversion/codeshell.py
- Command line
-
hf download hf://datasets/Brunobkr/llama.cpp_AlgMor24_github@9f63da05cd17e144eb118af61a784286378961ba/conversion/codeshell.py
-
curl -L -o codeshell.py https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github/resolve/9f63da05cd17e144eb118af61a784286378961ba/conversion/codeshell.py
973 Bytes
| from __future__ import annotations | |
| from .base import ModelBase, TextModel, gguf | |
| class CodeShellModel(TextModel): | |
| model_arch = gguf.MODEL_ARCH.CODESHELL | |
| def set_gguf_parameters(self): | |
| self.gguf_writer.add_context_length(self.hparams["n_positions"]) | |
| self.gguf_writer.add_embedding_length(self.hparams["n_embd"]) | |
| self.gguf_writer.add_feed_forward_length(4 * self.hparams["n_embd"]) | |
| self.gguf_writer.add_block_count(self.block_count) | |
| self.gguf_writer.add_head_count(self.hparams["n_head"]) | |
| self.gguf_writer.add_head_count_kv(self.hparams["num_query_groups"]) | |
| self.gguf_writer.add_layer_norm_eps(self.hparams["layer_norm_epsilon"]) | |
| self.gguf_writer.add_file_type(self.ftype) | |
| self.gguf_writer.add_rope_freq_base(10000.0) | |
| self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.LINEAR) | |
| self.gguf_writer.add_rope_scaling_factor(1.0) | |