magenta-js icon indicating copy to clipboard operation
magenta-js copied to clipboard

"TypeError: Only absolute URLs are supported" & "Only HTTP(S) protocols are supported"

Open jjannone opened this issue 1 year ago • 3 comments

Having downloaded models using checkpoint_downloader.py, I am attempting to load them locally.

As suggested in #576 I prepended file:// and get the error Only HTTP(S) protocols are supported

As suggested in #470 I used /modelName and continue to get the error Only absolute URLs are supported

Any other suggestions?

jjannone avatar Apr 07 '23 12:04 jjannone

Could you post your code? It's hard to tell what's going on otherwise.

notwaldorf avatar Apr 07 '23 20:04 notwaldorf

const musicvae = require('@magenta/music/node/music_vae');
const core = require('@magenta/music/node/core');
const Max = require('max-api');

var modelCheckPoint = 'https://storage.googleapis.com/magentadata/js/checkpoints/music_vae/mel_2bar_small'; //works

//////// fails with Only HTTP(S) protocols are supported ////////
//var modelCheckPoint = 'file://Users/johnjannone/Dropbox/_Projects__________________/_MAX/Magenta/drums_2bar_lokl_small';

//////// fails with Only absolute URLs are supported ////////
//var modelCheckPoint = '/drums_2bar_lokl_small';
//var modelCheckPoint = 'file:///Users/johnjannone/Dropbox/_Projects__________________/_MAX/Magenta/drums_2bar_lokl_small';

var MusicVAE = new musicvae.MusicVAE(modelCheckPoint);
MusicVAE.initialize()
	.then(function(MusicVAE) { 
		
     Max.post('MusicVAE initialized with model '+modelCheckPoint);

    });

jjannone avatar Apr 07 '23 21:04 jjannone

I am having this exact same problem.

jackm357 avatar Jul 19 '23 03:07 jackm357