Skip to content

[Bug] The model.save_pretrained_gguf() function wont run in .venv #2326

@OliDo99

Description

@OliDo99

The model.save_pretrained_gguf() function wont run in .venv environment the only thing that solved the issue was changing enviroments to conda
Saving a model in .venv using said function will throw this error -> Unsloth: The file ('llama.cpp/llama-quantize' or 'llama.cpp/llama-quantize.exe' if you are on Windows WSL) or 'llama.cpp/quantize' does not exist.
But we expect this file to exist! Maybe the llama.cpp developers changed the name or check extension of the llama-quantize file.

But the same code with same setup will run perfectly in conda
Is that a feature or a bug?

  1. Dataset Details:

    • Dataset: amarmahdi1112/human_chat_dataset_processed
    • Formating Function:
      def format_instruction(sample):
      return {
      "text": tokenizer.apply_chat_template(
      [
      {"role": "user", "content": sample["instruction"]},
      {"role": "assistant", "content": sample["output"]},
      ],
      tokenize=False,
      add_generation_prompt=False
      )
      }
  2. Model Details:
    Model didn't affect the result

  3. Training Config:
    trainer = SFTTrainer(
    model = model,
    tokenizer = tokenizer,
    train_dataset = dataset,
    dataset_text_field = "text",
    dataset_num_proc = 2,
    max_seq_length = 2048,
    packing = False,
    args = TrainingArguments(
    per_device_train_batch_size = 2,
    gradient_accumulation_steps = 4,
    warmup_steps = 5,
    max_steps = 60,
    learning_rate = 2e-4,
    fp16 = not is_bfloat16_supported(),
    bf16 = is_bfloat16_supported(),
    logging_steps = 1,
    optim = "adamw_8bit",
    weight_decay = 0.01,
    lr_scheduler_type = "linear",
    seed = 3407,
    output_dir = "outputs",
    report_to = "none",
    ),
    )

  4. Reproduction Steps:
    setup a .venv environment
    set a model you wish to fine tune, a tokenizer and the dataset
    set parameters for your

  5. Expected Behavior:
    It should run regardless of the environment, right?

  6. Actual Behavior:
    No it does not

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions