Skip to content

Adapter inference inaccurate #39

Description

@grocedj

After fine tuning, is it expected that we use peft to merge the adapter back to the base ChatTTS? How do we apply the LoRA weights to the model for inference? When I try to merge with peft, I get a voice that doesn't resemble the training data.

def load_model_with_adapter(base_model_id: str, adapter_model_id: str, device: torch.device) -> torch.nn.Module:
    base_model = AutoModelForCausalLM.from_pretrained(base_model_id)
    base_model.to(device)

    model = PeftModel.from_pretrained(base_model, adapter_model_id)
    merged_model = model.merge_and_unload()

    return merged_model

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions