From d46b9b7c50d2b47fc12302420c9048d5ffd1c3d0 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 21 Apr 2023 12:34:08 -0300 Subject: [PATCH] Fix evaluate comment saving --- modules/evaluate.py | 2 ++ modules/shared.py | 1 + modules/training.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/evaluate.py b/modules/evaluate.py index 9822dde..3134280 100644 --- a/modules/evaluate.py +++ b/modules/evaluate.py @@ -24,6 +24,8 @@ past_evaluations = load_past_evaluations() def save_past_evaluations(df): + global past_evaluations + past_evaluations = df df.to_csv(Path('logs/evaluations.csv'), index=False) diff --git a/modules/shared.py b/modules/shared.py index a08f134..d6cdc0b 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -123,6 +123,7 @@ parser.add_argument('--wbits', type=int, default=0, help='Load a pre-quantized m parser.add_argument('--model_type', type=str, help='Model type of pre-quantized model. Currently LLaMA, OPT, and GPT-J are supported.') parser.add_argument('--groupsize', type=int, default=-1, help='Group size.') parser.add_argument('--pre_layer', type=int, default=0, help='The number of layers to allocate to the GPU. Setting this parameter enables CPU offloading for 4-bit models.') +parser.add_argument('--file-path', type=int, default=0, help='Load a pre-quantized model with specified precision in bits. 2, 3, 4 and 8 are supported.') parser.add_argument('--monkey-patch', action='store_true', help='Apply the monkey patch for using LoRAs with quantized models.') parser.add_argument('--no-quant_attn', action='store_true', help='(triton) Disable quant attention. If you encounter incoherent results try disabling this.') parser.add_argument('--no-warmup_autotune', action='store_true', help='(triton) Disable warmup autotune.') diff --git a/modules/training.py b/modules/training.py index 000a1ce..70629ef 100644 --- a/modules/training.py +++ b/modules/training.py @@ -112,7 +112,7 @@ def create_train_interface(): evaluate_text_file = gr.Dropdown(choices=['wikitext', 'ptb', 'ptb_new'] + get_datasets('training/datasets', 'txt')[1:], value='wikitext', label='Input dataset', info='The raw text file on which the model will be evaluated. The first options are automatically downloaded: wikitext, ptb, and ptb_new. The next options are your local text files under training/datasets.') with gr.Row(): stride_length = gr.Slider(label='Stride', minimum=1, maximum=2048, value=512, step=1, info='Used to make the evaluation faster at the cost of accuracy. 1 = slowest but most accurate. 512 is a common value.') - max_length = gr.Slider(label='max_length', minimum=1, maximum=8096, value=0, step=1, info='The context for each evaluation. If set to 0, the maximum context length for the model will be used.') + max_length = gr.Slider(label='max_length', minimum=0, maximum=8096, value=0, step=1, info='The context for each evaluation. If set to 0, the maximum context length for the model will be used.') with gr.Row(): start_current_evaluation = gr.Button("Evaluate loaded model")