mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-12-25 13:58:56 +01:00
Bump llama-cpp-python
This commit is contained in:
parent
3e7c624f8e
commit
6170b5ba31
@ -262,6 +262,7 @@ Optionally, you can use the following command-line flags:
|
||||
| `--no-mmap` | Prevent mmap from being used. |
|
||||
| `--mlock` | Force the system to keep the model in RAM. |
|
||||
| `--cache-capacity CACHE_CAPACITY` | Maximum cache capacity. Examples: 2000MiB, 2GiB. When provided without units, bytes will be assumed. |
|
||||
| `--tensor_split TENSOR_SPLIT` | Split the model across multiple GPUs, comma-separated list of proportions, e.g. 18,17 |
|
||||
| `--llama_cpp_seed SEED` | Seed for llama-cpp models. Default 0 (random). |
|
||||
| `--n_gqa N_GQA` | grouped-query attention. Must be 8 for llama-2 70b. |
|
||||
| `--rms_norm_eps RMS_NORM_EPS` | 5e-6 is a good value for llama-2 models. |
|
||||
|
@ -102,6 +102,12 @@ class LlamacppHF(PreTrainedModel):
|
||||
model_file = list(path.glob('*ggml*.bin'))[0]
|
||||
|
||||
logger.info(f"llama.cpp weights detected: {model_file}\n")
|
||||
|
||||
if shared.args.tensor_split is None or shared.args.tensor_split.strip() == '':
|
||||
tensor_split_list = None
|
||||
else:
|
||||
tensor_split_list = [float(x) for x in shared.args.tensor_split.strip().split(",")]
|
||||
|
||||
params = {
|
||||
'model_path': str(model_file),
|
||||
'n_ctx': shared.args.n_ctx,
|
||||
@ -113,6 +119,7 @@ class LlamacppHF(PreTrainedModel):
|
||||
'low_vram': shared.args.low_vram,
|
||||
'n_gpu_layers': shared.args.n_gpu_layers,
|
||||
'rope_freq_base': 10000 * shared.args.alpha_value ** (64 / 63.),
|
||||
'tensor_split': tensor_split_list,
|
||||
'rope_freq_scale': 1.0 / shared.args.compress_pos_emb,
|
||||
'n_gqa': shared.args.n_gqa or None,
|
||||
'rms_norm_eps': shared.args.rms_norm_eps or None,
|
||||
|
@ -55,6 +55,12 @@ class LlamaCppModel:
|
||||
cache_capacity = int(shared.args.cache_capacity)
|
||||
|
||||
logger.info("Cache capacity is " + str(cache_capacity) + " bytes")
|
||||
|
||||
if shared.args.tensor_split is None or shared.args.tensor_split.strip() == '':
|
||||
tensor_split_list = None
|
||||
else:
|
||||
tensor_split_list = [float(x) for x in shared.args.tensor_split.strip().split(",")]
|
||||
|
||||
params = {
|
||||
'model_path': str(path),
|
||||
'n_ctx': shared.args.n_ctx,
|
||||
@ -66,6 +72,7 @@ class LlamaCppModel:
|
||||
'low_vram': shared.args.low_vram,
|
||||
'n_gpu_layers': shared.args.n_gpu_layers,
|
||||
'rope_freq_base': 10000 * shared.args.alpha_value ** (64 / 63.),
|
||||
'tensor_split': tensor_split_list,
|
||||
'rope_freq_scale': 1.0 / shared.args.compress_pos_emb,
|
||||
'n_gqa': shared.args.n_gqa or None,
|
||||
'rms_norm_eps': shared.args.rms_norm_eps or None,
|
||||
|
@ -67,6 +67,7 @@ loaders_and_params = OrderedDict({
|
||||
'n_gqa',
|
||||
'rms_norm_eps',
|
||||
'n_gpu_layers',
|
||||
'tensor_split',
|
||||
'n_batch',
|
||||
'threads',
|
||||
'no_mmap',
|
||||
@ -82,6 +83,7 @@ loaders_and_params = OrderedDict({
|
||||
'n_gqa',
|
||||
'rms_norm_eps',
|
||||
'n_gpu_layers',
|
||||
'tensor_split',
|
||||
'n_batch',
|
||||
'threads',
|
||||
'no_mmap',
|
||||
|
@ -121,6 +121,7 @@ parser.add_argument('--low-vram', action='store_true', help='Low VRAM Mode')
|
||||
parser.add_argument('--mlock', action='store_true', help='Force the system to keep the model in RAM.')
|
||||
parser.add_argument('--cache-capacity', type=str, help='Maximum cache capacity. Examples: 2000MiB, 2GiB. When provided without units, bytes will be assumed.')
|
||||
parser.add_argument('--n-gpu-layers', type=int, default=0, help='Number of layers to offload to the GPU.')
|
||||
parser.add_argument('--tensor_split', type=str, default=None, help="Split the model across multiple GPUs, comma-separated list of proportions, e.g. 18,17")
|
||||
parser.add_argument('--n_ctx', type=int, default=2048, help='Size of the prompt context.')
|
||||
parser.add_argument('--llama_cpp_seed', type=int, default=0, help='Seed for llama-cpp models. Default 0 (random)')
|
||||
parser.add_argument('--n_gqa', type=int, default=0, help='grouped-query attention. Must be 8 for llama-2 70b.')
|
||||
|
@ -69,6 +69,7 @@ def list_model_elements():
|
||||
'low_vram',
|
||||
'mlock',
|
||||
'n_gpu_layers',
|
||||
'tensor_split',
|
||||
'n_ctx',
|
||||
'n_gqa',
|
||||
'rms_norm_eps',
|
||||
|
@ -31,8 +31,8 @@ https://github.com/jllllll/exllama/releases/download/0.0.10/exllama-0.0.10+cu117
|
||||
https://github.com/jllllll/exllama/releases/download/0.0.10/exllama-0.0.10+cu117-cp310-cp310-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64"
|
||||
|
||||
# llama-cpp-python without GPU support
|
||||
llama-cpp-python==0.1.77; platform_system != "Windows"
|
||||
https://github.com/abetlen/llama-cpp-python/releases/download/v0.1.77/llama_cpp_python-0.1.77-cp310-cp310-win_amd64.whl; platform_system == "Windows"
|
||||
llama-cpp-python==0.1.78; platform_system != "Windows"
|
||||
https://github.com/abetlen/llama-cpp-python/releases/download/v0.1.78/llama_cpp_python-0.1.78-cp310-cp310-win_amd64.whl; platform_system == "Windows"
|
||||
# llama-cpp-python with CUDA support
|
||||
https://github.com/jllllll/llama-cpp-python-cuBLAS-wheels/releases/download/textgen-webui/llama_cpp_python_cuda-0.1.77+cu117-cp310-cp310-win_amd64.whl; platform_system == "Windows"
|
||||
https://github.com/jllllll/llama-cpp-python-cuBLAS-wheels/releases/download/textgen-webui/llama_cpp_python_cuda-0.1.77+cu117-cp310-cp310-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64"
|
||||
|
Loading…
Reference in New Issue
Block a user