You're looking at a specific version of this model. Jump to the model overview.
andreasjansson /music-inpainting-bert:58bdc207
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run andreasjansson/music-inpainting-bert using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"andreasjansson/music-inpainting-bert:58bdc2073c9c07abcc4200fe808e15b1a555dbb1390e70f5daa6b3d81bd11fb1",
{
input: {
seed: -1,
notes: "c8 g4 f g.4 | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ?",
tempo: 120,
chords: "Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Gmaj7 | Gmaj7 | Fm7 | Fm7 | D-maj7 | E-maj7 | Cmaj7 | Cmaj7",
sample_width: 10,
time_signature: 4
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run andreasjansson/music-inpainting-bert using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/music-inpainting-bert:58bdc2073c9c07abcc4200fe808e15b1a555dbb1390e70f5daa6b3d81bd11fb1",
input={
"seed": -1,
"notes": "c8 g4 f g.4 | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ?",
"tempo": 120,
"chords": "Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Gmaj7 | Gmaj7 | Fm7 | Fm7 | D-maj7 | E-maj7 | Cmaj7 | Cmaj7",
"sample_width": 10,
"time_signature": 4
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run andreasjansson/music-inpainting-bert using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "58bdc2073c9c07abcc4200fe808e15b1a555dbb1390e70f5daa6b3d81bd11fb1",
"input": {
"seed": -1,
"notes": "c8 g4 f g.4 | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ?",
"tempo": 120,
"chords": "Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Gmaj7 | Gmaj7 | Fm7 | Fm7 | D-maj7 | E-maj7 | Cmaj7 | Cmaj7",
"sample_width": 10,
"time_signature": 4
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run andreasjansson/music-inpainting-bert using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/andreasjansson/music-inpainting-bert@sha256:58bdc2073c9c07abcc4200fe808e15b1a555dbb1390e70f5daa6b3d81bd11fb1 \
-i 'seed=-1' \
-i 'notes="c8 g4 f g.4 | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ?"' \
-i 'tempo=120' \
-i 'chords="Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Gmaj7 | Gmaj7 | Fm7 | Fm7 | D-maj7 | E-maj7 | Cmaj7 | Cmaj7"' \
-i 'sample_width=10' \
-i 'time_signature=4'
To learn more, take a look at the Cog documentation.
Pull and run andreasjansson/music-inpainting-bert using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/andreasjansson/music-inpainting-bert@sha256:58bdc2073c9c07abcc4200fe808e15b1a555dbb1390e70f5daa6b3d81bd11fb1
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "seed": -1, "notes": "c8 g4 f g.4 | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ?", "tempo": 120, "chords": "Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Gmaj7 | Gmaj7 | Fm7 | Fm7 | D-maj7 | E-maj7 | Cmaj7 | Cmaj7", "sample_width": 10, "time_signature": 4 } }' \ http://localhost:5000/predictions
Add a payment method to run this model.
Each run costs approximately $0.0014. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
mp3
- Chapters
- descriptions off, selected
- captions settings, opens captions settings dialog
- captions off, selected
This is a modal window.
Beginning of dialog window. Escape will cancel and close the window.
End of dialog window.
midi
out.midi{
"completed_at": "2022-05-03T19:32:26.717006Z",
"created_at": "2022-05-03T19:32:17.700984Z",
"data_removed": false,
"error": null,
"id": "oz3dif2lijfa3ac2bkzidysbxa",
"input": {
"seed": -1,
"notes": "c8 g4 f g.4 | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ? | ?",
"tempo": "120",
"chords": "Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Cmaj7 | Cmaj7 | E-maj7 | E-maj7 | Gmaj7 | Gmaj7 | Fm7 | Fm7 | D-maj7 | E-maj7 | Cmaj7 | Cmaj7",
"sample_width": "10",
"time_signature": "4"
},
"logs": "Using seed: 41511\n0.0 10\n0.1 8\n0.2 6\n0.3 6\n0.4 5\n0.5 4\n0.6 4\n0.7 3\n0.8 2\n0.9 2\n0:0 (0/1 C4), (1/2 G4) Cmaj7 0\n0:1 (1/2 F4) Cmaj7 0\n0:2 (1/2 G4) Cmaj7 0\n3: Invalid pattern: 0\n1:0 (0/1 G4) Cmaj7 1\n1:1 (1/2 G4) Cmaj7 5\n1:2 Cmaj7 9\n2:3 Cmaj7 8\n2:0 (0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cmaj7 7\n15:0 (0/1 C4) Cmaj7 1\n15:1 Cmaj7 7\n15:2 (1/2 G4) Cmaj7 2\n0 pattern\nffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers\n built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)\n configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared\n libavutil 55. 78.100 / 55. 78.100\n libavcodec 57.107.100 / 57.107.100\n libavformat 57. 83.100 / 57. 83.100\n libavdevice 57. 10.100 / 57. 10.100\n libavfilter 6.107.100 / 6.107.100\n libavresample 3. 7. 0 / 3. 7. 0\n libswscale 4. 8.100 / 4. 8.100\n libswresample 2. 9.100 / 2. 9.100\n libpostproc 54. 7.100 / 54. 7.100\nGuessed Channel Layout for Input Stream #0.0 : mono\nInput #0, wav, from '/tmp/tmpnuth5955/out.wav':\n Duration: 00:00:32.50, bitrate: 2822 kb/s\n Stream #0:0: Audio: pcm_f64le ([3][0][0][0] / 0x0003), 44100 Hz, mono, dbl, 2822 kb/s\nStream mapping:\n Stream #0:0 -> #0:0 (pcm_f64le (native) -> mp3 (libmp3lame))\nPress [q] to stop, [?] for help\nOutput #0, mp3, to '/tmp/tmpnuth5955/out.mp3':\n Metadata:\n TSSE : Lavf57.83.100\n Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, mono, fltp\n Metadata:\n encoder : Lavc57.107.100 libmp3lame\nsize= 252kB time=00:00:32.15 bitrate= 64.1kbits/s speed=72.2x\nvideo:0kB audio:251kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.088168%\nLY output to `/tmp/tmpnuth5955/score.ly'...\nChanging working directory to: `/tmp/tmpnuth5955'\nProcessing `/tmp/tmpnuth5955/score.ly'\nParsing...\nInterpreting music...[8][16][16]\nPreprocessing graphical objects...\nInterpreting music...\nMIDI output to `score.midi'...\nFinding the ideal number of pages...\nFitting music on 1 page...\nDrawing systems...\nLayout output to `score.ps'...\nConverting to PNG...\nSuccess: compilation successfully completed",
"metrics": {
"predict_time": 8.793683,
"total_time": 9.016022
},
"output": {
"mp3": "https://replicate.delivery/mgxm/f1a45940-4144-47ce-9695-e994c47ad143/out.mp3",
"midi": "https://replicate.delivery/mgxm/f9130a4a-ed2a-4a6a-91d0-bc9cba1df39f/out.midi",
"score": "https://replicate.delivery/mgxm/08c47365-c531-403b-8a27-633229bd5932/score.png"
},
"started_at": "2022-05-03T19:32:17.923323Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/oz3dif2lijfa3ac2bkzidysbxa",
"cancel": "https://api.replicate.com/v1/predictions/oz3dif2lijfa3ac2bkzidysbxa/cancel"
},
"version": "58bdc2073c9c07abcc4200fe808e15b1a555dbb1390e70f5daa6b3d81bd11fb1"
}
Using seed: 41511
0.0 10
0.1 8
0.2 6
0.3 6
0.4 5
0.5 4
0.6 4
0.7 3
0.8 2
0.9 2
0:0 (0/1 C4), (1/2 G4) Cmaj7 0
0:1 (1/2 F4) Cmaj7 0
0:2 (1/2 G4) Cmaj7 0
3: Inval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14:1 Cmaj7 7
14:2 Cmaj7 6
15:3 Cmaj7 7
15:0 (0/1 C4) Cmaj7 1
15:1 Cmaj7 7
15:2 (1/2 G4) Cmaj7 2
0 pattern
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from '/tmp/tmpnuth5955/out.wav':
Duration: 00:00:32.50, bitrate: 2822 kb/s
Stream #0:0: Audio: pcm_f64le ([3][0][0][0] / 0x0003), 44100 Hz, mono, dbl, 2822 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_f64le (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to '/tmp/tmpnuth5955/out.mp3':
Metadata:
TSSE : Lavf57.83.100
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, mono, fltp
Metadata:
encoder : Lavc57.107.100 libmp3lame
size= 252kB time=00:00:32.15 bitrate= 64.1kbits/s speed=72.2x
video:0kB audio:251kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.088168%
LY output to `/tmp/tmpnuth5955/score.ly'...
Changing working directory to: `/tmp/tmpnuth5955'
Processing `/tmp/tmpnuth5955/score.ly'
Parsing...
Interpreting music...[8][16][16]
Preprocessing graphical objects...
Interpreting music...
MIDI output to `score.midi'...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `score.ps'...
Converting to PNG...
Success: compilation successfully completed