Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 37 #38

Merged
merged 2 commits into from
Jun 24, 2024
Merged

fix 37 #38

merged 2 commits into from
Jun 24, 2024

Conversation

antoine-tran
Copy link
Contributor

@antoine-tran antoine-tran commented Jun 24, 2024

Why ?

fixes #37

The PR fixes the renaming issues in checkpoint compilation script.

Test plan

  1. Train a new dummy model using AudioCraft:
git clone git@github.com:facebookresearch/audiocraft.git
cd audiocraft
python -m pip install -e ".[wm]"

AUDIOCRAFT_DORA_DIR="/tmp/wm_${USER}" \
    dora run device=cpu dataset.num_workers=0 optim.epochs=1 \
    dataset.train.num_samples=10 \
    dataset.valid.num_samples=10 \
    dataset.evaluate.num_samples=10 \
    dataset.generate.num_samples=10 \
    solver=watermark/robustness \
    checkpoint.save_last=true \
    dset=audio/example

/tmp/wm_${USER}/xps/SOME_HASH_CODE/checkpoint.th

You should see the output such as:

  1. Generate the checkpoints in audioseal-friendly format:
cd [AudioSeal code directory]
python src/scripts/checkpoints.py /tmp/wm_${USER}/xps/SOME_HASH_CODE/checkpoint.th OUTPUT_DIR
  1. Try load the checkpoints using AudioSeal API:
from audioseal import AudioSeal
generator = AudioSeal.load_generator("[OUTPUT_DIR/checkpoint_generator_base.pth", nbits=16)

detector = AudioSeal.load_detector("[OUTPUT_DIR/checkpoint_detector_base.pth", nbits=16)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 24, 2024
@antoine-tran antoine-tran merged commit f95f92e into main Jun 24, 2024
6 checks passed
@antoine-tran antoine-tran deleted the fix_37 branch June 24, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to load finetuned checkpoint
2 participants