import{S as js,i as Js,s as ks,e as n,k as p,w as h,t as r,M as Us,c as a,d as t,m as u,a as s,x as f,h as i,b as d,N as Es,G as o,g as c,y as g,q as _,o as y,B as b,v as Is}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ts}from"../../chunks/Tip-hf-doc-builder.js";import{D as V}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ao}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ye}from"../../chunks/IconCopyLink-hf-doc-builder.js";function Cs(Ye){let m,U,w,M,J;return{c(){m=n("p"),U=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),w=n("code"),M=r("Module"),J=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(P){m=a(P,"P",{});var j=s(m);U=i(j,"Although the recipe for forward pass needs to be defined within this function, one should call the "),w=a(j,"CODE",{});var E=s(w);M=i(E,"Module"),E.forEach(t),J=i(j,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),j.forEach(t)},m(P,j){c(P,m,j),o(m,U),o(m,w),o(w,M),o(m,J)},d(P){P&&t(m)}}}function Gs(Ye){let m,U,w,M,J,P,j,E,R,te,I,k,$,Ae;return{c(){m=n("p"),U=r("Most generation-controlling parameters are set in "),w=n("code"),M=r("generation_config"),J=r(` which, if not passed, will be set to the
model\u2019s default generation configuration. You can override any `),P=n("code"),j=r("generation_config"),E=r(` by passing the corresponding
parameters to generate(), e.g. `),R=n("code"),te=r(".generate(inputs, num_beams=4, do_sample=True)"),I=r(`. For an overview of generation
strategies and code examples, check out the `),k=n("a"),$=r("following guide"),Ae=r("."),this.h()},l(z){m=a(z,"P",{});var v=s(m);U=i(v,"Most generation-controlling parameters are set in "),w=a(v,"CODE",{});var C=s(w);M=i(C,"generation_config"),C.forEach(t),J=i(v,` which, if not passed, will be set to the
model\u2019s default generation configuration. You can override any `),P=a(v,"CODE",{});var ne=s(P);j=i(ne,"generation_config"),ne.forEach(t),E=i(v,` by passing the corresponding
parameters to generate(), e.g. `),R=a(v,"CODE",{});var F=s(R);te=i(F,".generate(inputs, num_beams=4, do_sample=True)"),F.forEach(t),I=i(v,`. For an overview of generation
strategies and code examples, check out the `),k=a(v,"A",{href:!0});var De=s(k);$=i(De,"following guide"),De.forEach(t),Ae=i(v,"."),v.forEach(t),this.h()},h(){d(k,"href","./generation_strategies")},m(z,v){c(z,m,v),o(m,U),o(m,w),o(w,M),o(m,J),o(m,P),o(P,j),o(m,E),o(m,R),o(R,te),o(m,I),o(m,k),o(k,$),o(m,Ae)},d(z){z&&t(m)}}}function $s(Ye){let m,U,w,M,J,P,j,E,R,te,I,k,$,Ae,z,v,C,ne,F,De,wo,xt,Do,ae,qt,be,Qt,St,Oo,Oe,Ht,Lo,se,Yt,ve,At,Dt,Ko,Le,Ot,et,Ke,Po,Lt,ot,eo,Kt,tt,oo,Mo,en,nt,we,at,re,on,To,tn,nn,st,Z,an,Pe,sn,rn,Me,ln,dn,rt,N,ie,jo,Te,cn,Jo,pn,it,to,ko,un,lt,je,dt,no,Uo,mn,ct,Je,pt,ao,Eo,hn,ut,ke,mt,so,x,fn,Io,gn,_n,Co,yn,bn,ht,Ue,ft,q,le,Go,Ee,vn,$o,wn,gt,G,Ie,Pn,Q,Mn,ro,Tn,jn,Ce,Jn,kn,Un,S,En,io,In,Cn,lo,Gn,$n,_t,H,de,zo,Ge,zn,Fo,Fn,yt,Y,$e,Zn,ce,ze,Xn,Zo,Wn,bt,A,pe,Xo,Fe,Bn,Wo,Vn,vt,T,Ze,Rn,D,Nn,Bo,xn,qn,co,Qn,Sn,Hn,Xe,Yn,We,An,Dn,On,X,Be,Ln,O,Kn,po,ea,oa,Vo,ta,na,aa,ue,sa,W,Ve,ra,Ro,ia,la,me,wt,L,he,No,Re,da,xo,ca,Pt,K,Ne,pa,fe,xe,ua,qo,ma,Mt,ee,ge,Qo,qe,ha,So,fa,Tt,oe,Qe,ga,_e,Se,_a,Ho,ya,jt;return P=new ye({}),F=new ye({}),we=new Ao({props:{code:"cGlwJTIwaW5zdGFsbCUyMHByZXR0eS1taWRpJTNEJTNEMC4yLjklMjBlc3NlbnRpYSUzRCUzRDIuMWI2LmRldjEwMzQlMjBsaWJyb3NhJTIwc2NpcHk=",highlighted:'pip install pretty-midi==<span class="hljs-number">0.2</span><span class="hljs-number">.9</span> essentia==<span class="hljs-number">2.1b6</span>.dev1034 librosa scipy'}}),Te=new ye({}),je=new Ao({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBvcDJQaWFub0ZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUyQyUyMFBvcDJQaWFub1Byb2Nlc3NvciUwQSUwQW1vZGVsJTIwJTNEJTIwUG9wMlBpYW5vRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJzd2VldGNvY29hJTJGcG9wMnBpYW5vJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMFBvcDJQaWFub1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyc3dlZXRjb2NvYSUyRnBvcDJwaWFubyUyMiklMEFkcyUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJzd2VldGNvY29hJTJGcG9wMnBpYW5vX2NpJTIyJTJDJTIwc3BsaXQlM0QlMjJ0ZXN0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMEElMjAlMjAlMjAlMjBhdWRpbyUzRGRzJTVCJTIyYXVkaW8lMjIlNUQlNUIwJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEZHMlNUIlMjJhdWRpbyUyMiU1RCU1QjAlNUQlNUIlMjJzYW1wbGluZ19yYXRlJTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSklMEFtb2RlbF9vdXRwdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dF9mZWF0dXJlcyUzRGlucHV0cyU1QiUyMmlucHV0X2ZlYXR1cmVzJTIyJTVEJTJDJTIwY29tcG9zZXIlM0QlMjJjb21wb3NlcjElMjIpJTBBdG9rZW5pemVyX291dHB1dCUyMCUzRCUyMHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUoJTBBJTIwJTIwJTIwJTIwdG9rZW5faWRzJTNEbW9kZWxfb3V0cHV0JTJDJTIwZmVhdHVyZV9leHRyYWN0b3Jfb3V0cHV0JTNEaW5wdXRzJTBBKSU1QiUyMnByZXR0eV9taWRpX29iamVjdHMlMjIlNUQlNUIwJTVEJTBBdG9rZW5pemVyX291dHB1dC53cml0ZSglMjIuJTJGT3V0cHV0cyUyRm1pZGlfb3V0cHV0Lm1pZCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Pop2PianoForConditionalGeneration, Pop2PianoProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>model = Pop2PianoForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;sweetcocoa/pop2piano&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Pop2PianoProcessor.from_pretrained(<span class="hljs-string">&quot;sweetcocoa/pop2piano&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;sweetcocoa/pop2piano_ci&quot;</span>, split=<span class="hljs-string">&quot;test&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(
<span class="hljs-meta">... </span>    audio=ds[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-number">0</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=ds[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-number">0</span>][<span class="hljs-string">&quot;sampling_rate&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model_output = model.generate(input_features=inputs[<span class="hljs-string">&quot;input_features&quot;</span>], composer=<span class="hljs-string">&quot;composer1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output = processor.batch_decode(
<span class="hljs-meta">... </span>    token_ids=model_output, feature_extractor_output=inputs
<span class="hljs-meta">... </span>)[<span class="hljs-string">&quot;pretty_midi_objects&quot;</span>][<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output.write(<span class="hljs-string">&quot;./Outputs/midi_output.mid&quot;</span>)`}}),Je=new Ao({props:{code:"aW1wb3J0JTIwbGlicm9zYSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBQb3AyUGlhbm9Gb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMkMlMjBQb3AyUGlhbm9Qcm9jZXNzb3IlMEElMEFhdWRpbyUyQyUyMHNyJTIwJTNEJTIwbGlicm9zYS5sb2FkKCUyMiUzQ3lvdXJfYXVkaW9fZmlsZV9oZXJlJTNFJTIyJTJDJTIwc3IlM0Q0NDEwMCklMjAlMjAlMjMlMjBmZWVsJTIwZnJlZSUyMHRvJTIwY2hhbmdlJTIwdGhlJTIwc3IlMjB0byUyMGElMjBzdWl0YWJsZSUyMHZhbHVlLiUwQW1vZGVsJTIwJTNEJTIwUG9wMlBpYW5vRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJzd2VldGNvY29hJTJGcG9wMnBpYW5vJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMFBvcDJQaWFub1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyc3dlZXRjb2NvYSUyRnBvcDJwaWFubyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoYXVkaW8lM0RhdWRpbyUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzciUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBbW9kZWxfb3V0cHV0JTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfZmVhdHVyZXMlM0RpbnB1dHMlNUIlMjJpbnB1dF9mZWF0dXJlcyUyMiU1RCUyQyUyMGNvbXBvc2VyJTNEJTIyY29tcG9zZXIxJTIyKSUwQXRva2VuaXplcl9vdXRwdXQlMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKCUwQSUyMCUyMCUyMCUyMHRva2VuX2lkcyUzRG1vZGVsX291dHB1dCUyQyUyMGZlYXR1cmVfZXh0cmFjdG9yX291dHB1dCUzRGlucHV0cyUwQSklNUIlMjJwcmV0dHlfbWlkaV9vYmplY3RzJTIyJTVEJTVCMCU1RCUwQXRva2VuaXplcl9vdXRwdXQud3JpdGUoJTIyLiUyRk91dHB1dHMlMkZtaWRpX291dHB1dC5taWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> librosa
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Pop2PianoForConditionalGeneration, Pop2PianoProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>audio, sr = librosa.load(<span class="hljs-string">&quot;&lt;your_audio_file_here&gt;&quot;</span>, sr=<span class="hljs-number">44100</span>)  <span class="hljs-comment"># feel free to change the sr to a suitable value.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Pop2PianoForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;sweetcocoa/pop2piano&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Pop2PianoProcessor.from_pretrained(<span class="hljs-string">&quot;sweetcocoa/pop2piano&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(audio=audio, sampling_rate=sr, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model_output = model.generate(input_features=inputs[<span class="hljs-string">&quot;input_features&quot;</span>], composer=<span class="hljs-string">&quot;composer1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output = processor.batch_decode(
<span class="hljs-meta">... </span>    token_ids=model_output, feature_extractor_output=inputs
<span class="hljs-meta">... </span>)[<span class="hljs-string">&quot;pretty_midi_objects&quot;</span>][<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output.write(<span class="hljs-string">&quot;./Outputs/midi_output.mid&quot;</span>)`}}),ke=new Ao({props:{code:"aW1wb3J0JTIwbGlicm9zYSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBQb3AyUGlhbm9Gb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMkMlMjBQb3AyUGlhbm9Qcm9jZXNzb3IlMEElMEElMjMlMjBmZWVsJTIwZnJlZSUyMHRvJTIwY2hhbmdlJTIwdGhlJTIwc3IlMjB0byUyMGElMjBzdWl0YWJsZSUyMHZhbHVlLiUwQWF1ZGlvMSUyQyUyMHNyMSUyMCUzRCUyMGxpYnJvc2EubG9hZCglMjIlM0N5b3VyX2ZpcnN0X2F1ZGlvX2ZpbGVfaGVyZSUzRSUyMiUyQyUyMHNyJTNENDQxMDApJTIwJTIwJTBBYXVkaW8yJTJDJTIwc3IyJTIwJTNEJTIwbGlicm9zYS5sb2FkKCUyMiUzQ3lvdXJfc2Vjb25kX2F1ZGlvX2ZpbGVfaGVyZSUzRSUyMiUyQyUyMHNyJTNENDQxMDApJTBBbW9kZWwlMjAlM0QlMjBQb3AyUGlhbm9Gb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnN3ZWV0Y29jb2ElMkZwb3AycGlhbm8lMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwUG9wMlBpYW5vUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzd2VldGNvY29hJTJGcG9wMnBpYW5vJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihhdWRpbyUzRCU1QmF1ZGlvMSUyQyUyMGF1ZGlvMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0QlNUJzcjElMkMlMjBzcjIlNUQlMkMlMjByZXR1cm5fYXR0ZW50aW9uX21hc2slM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMjMlMjBTaW5jZSUyMHdlJTIwbm93JTIwZ2VuZXJhdGluZyUyMGluJTIwYmF0Y2goMiUyMGF1ZGlvcyklMjB3ZSUyMG11c3QlMjBwYXNzJTIwdGhlJTIwYXR0ZW50aW9uX21hc2slMEFtb2RlbF9vdXRwdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSglMEElMjAlMjAlMjAlMjBpbnB1dF9mZWF0dXJlcyUzRGlucHV0cyU1QiUyMmlucHV0X2ZlYXR1cmVzJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwYXR0ZW50aW9uX21hc2slM0RpbnB1dHMlNUIlMjJhdHRlbnRpb25fbWFzayUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGNvbXBvc2VyJTNEJTIyY29tcG9zZXIxJTIyJTJDJTBBKSUwQXRva2VuaXplcl9vdXRwdXQlMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKCUwQSUyMCUyMCUyMCUyMHRva2VuX2lkcyUzRG1vZGVsX291dHB1dCUyQyUyMGZlYXR1cmVfZXh0cmFjdG9yX291dHB1dCUzRGlucHV0cyUwQSklNUIlMjJwcmV0dHlfbWlkaV9vYmplY3RzJTIyJTVEJTBBJTBBJTIzJTIwU2luY2UlMjB3ZSUyMG5vdyUyMGhhdmUlMjAyJTIwZ2VuZXJhdGVkJTIwTUlESSUyMGZpbGVzJTBBdG9rZW5pemVyX291dHB1dCU1QjAlNUQud3JpdGUoJTIyLiUyRk91dHB1dHMlMkZtaWRpX291dHB1dDEubWlkJTIyKSUwQXRva2VuaXplcl9vdXRwdXQlNUIxJTVELndyaXRlKCUyMi4lMkZPdXRwdXRzJTJGbWlkaV9vdXRwdXQyLm1pZCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> librosa
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Pop2PianoForConditionalGeneration, Pop2PianoProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># feel free to change the sr to a suitable value.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>audio1, sr1 = librosa.load(<span class="hljs-string">&quot;&lt;your_first_audio_file_here&gt;&quot;</span>, sr=<span class="hljs-number">44100</span>)  
<span class="hljs-meta">&gt;&gt;&gt; </span>audio2, sr2 = librosa.load(<span class="hljs-string">&quot;&lt;your_second_audio_file_here&gt;&quot;</span>, sr=<span class="hljs-number">44100</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Pop2PianoForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;sweetcocoa/pop2piano&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Pop2PianoProcessor.from_pretrained(<span class="hljs-string">&quot;sweetcocoa/pop2piano&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(audio=[audio1, audio2], sampling_rate=[sr1, sr2], return_attention_mask=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Since we now generating in batch(2 audios) we must pass the attention_mask</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model_output = model.generate(
<span class="hljs-meta">... </span>    input_features=inputs[<span class="hljs-string">&quot;input_features&quot;</span>],
<span class="hljs-meta">... </span>    attention_mask=inputs[<span class="hljs-string">&quot;attention_mask&quot;</span>],
<span class="hljs-meta">... </span>    composer=<span class="hljs-string">&quot;composer1&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output = processor.batch_decode(
<span class="hljs-meta">... </span>    token_ids=model_output, feature_extractor_output=inputs
<span class="hljs-meta">... </span>)[<span class="hljs-string">&quot;pretty_midi_objects&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Since we now have 2 generated MIDI files</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output[<span class="hljs-number">0</span>].write(<span class="hljs-string">&quot;./Outputs/midi_output1.mid&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output[<span class="hljs-number">1</span>].write(<span class="hljs-string">&quot;./Outputs/midi_output2.mid&quot;</span>)`}}),Ue=new Ao({props:{code:"aW1wb3J0JTIwbGlicm9zYSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBQb3AyUGlhbm9Gb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMkMlMjBQb3AyUGlhbm9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwUG9wMlBpYW5vVG9rZW5pemVyJTBBJTBBJTIzJTIwZmVlbCUyMGZyZWUlMjB0byUyMGNoYW5nZSUyMHRoZSUyMHNyJTIwdG8lMjBhJTIwc3VpdGFibGUlMjB2YWx1ZS4lMEFhdWRpbzElMkMlMjBzcjElMjAlM0QlMjBsaWJyb3NhLmxvYWQoJTIyJTNDeW91cl9maXJzdF9hdWRpb19maWxlX2hlcmUlM0UlMjIlMkMlMjBzciUzRDQ0MTAwKSUyMCUyMCUwQWF1ZGlvMiUyQyUyMHNyMiUyMCUzRCUyMGxpYnJvc2EubG9hZCglMjIlM0N5b3VyX3NlY29uZF9hdWRpb19maWxlX2hlcmUlM0UlMjIlMkMlMjBzciUzRDQ0MTAwKSUwQW1vZGVsJTIwJTNEJTIwUG9wMlBpYW5vRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJzd2VldGNvY29hJTJGcG9wMnBpYW5vJTIyKSUwQWZlYXR1cmVfZXh0cmFjdG9yJTIwJTNEJTIwUG9wMlBpYW5vRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyc3dlZXRjb2NvYSUyRnBvcDJwaWFubyUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBQb3AyUGlhbm9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnN3ZWV0Y29jb2ElMkZwb3AycGlhbm8lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwZmVhdHVyZV9leHRyYWN0b3IoJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0QlNUJhdWRpbzElMkMlMjBhdWRpbzIlNUQlMkMlMjAlMEElMjAlMjAlMjAlMjBzYW1wbGluZ19yYXRlJTNEJTVCc3IxJTJDJTIwc3IyJTVEJTJDJTIwJTBBJTIwJTIwJTIwJTIwcmV0dXJuX2F0dGVudGlvbl9tYXNrJTNEVHJ1ZSUyQyUyMCUwQSUyMCUyMCUyMCUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMEEpJTBBJTIzJTIwU2luY2UlMjB3ZSUyMG5vdyUyMGdlbmVyYXRpbmclMjBpbiUyMGJhdGNoKDIlMjBhdWRpb3MpJTIwd2UlMjBtdXN0JTIwcGFzcyUyMHRoZSUyMGF0dGVudGlvbl9tYXNrJTBBbW9kZWxfb3V0cHV0JTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoJTBBJTIwJTIwJTIwJTIwaW5wdXRfZmVhdHVyZXMlM0RpbnB1dHMlNUIlMjJpbnB1dF9mZWF0dXJlcyUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGF0dGVudGlvbl9tYXNrJTNEaW5wdXRzJTVCJTIyYXR0ZW50aW9uX21hc2slMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBjb21wb3NlciUzRCUyMmNvbXBvc2VyMSUyMiUyQyUwQSklMEF0b2tlbml6ZXJfb3V0cHV0JTIwJTNEJTIwdG9rZW5pemVyLmJhdGNoX2RlY29kZSglMEElMjAlMjAlMjAlMjB0b2tlbl9pZHMlM0Rtb2RlbF9vdXRwdXQlMkMlMjBmZWF0dXJlX2V4dHJhY3Rvcl9vdXRwdXQlM0RpbnB1dHMlMEEpJTVCJTIycHJldHR5X21pZGlfb2JqZWN0cyUyMiU1RCUwQSUwQSUyMyUyMFNpbmNlJTIwd2UlMjBub3clMjBoYXZlJTIwMiUyMGdlbmVyYXRlZCUyME1JREklMjBmaWxlcyUwQXRva2VuaXplcl9vdXRwdXQlNUIwJTVELndyaXRlKCUyMi4lMkZPdXRwdXRzJTJGbWlkaV9vdXRwdXQxLm1pZCUyMiklMEF0b2tlbml6ZXJfb3V0cHV0JTVCMSU1RC53cml0ZSglMjIuJTJGT3V0cHV0cyUyRm1pZGlfb3V0cHV0Mi5taWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> librosa
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Pop2PianoForConditionalGeneration, Pop2PianoFeatureExtractor, Pop2PianoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># feel free to change the sr to a suitable value.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>audio1, sr1 = librosa.load(<span class="hljs-string">&quot;&lt;your_first_audio_file_here&gt;&quot;</span>, sr=<span class="hljs-number">44100</span>)  
<span class="hljs-meta">&gt;&gt;&gt; </span>audio2, sr2 = librosa.load(<span class="hljs-string">&quot;&lt;your_second_audio_file_here&gt;&quot;</span>, sr=<span class="hljs-number">44100</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Pop2PianoForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;sweetcocoa/pop2piano&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Pop2PianoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;sweetcocoa/pop2piano&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = Pop2PianoTokenizer.from_pretrained(<span class="hljs-string">&quot;sweetcocoa/pop2piano&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(
<span class="hljs-meta">... </span>    audio=[audio1, audio2], 
<span class="hljs-meta">... </span>    sampling_rate=[sr1, sr2], 
<span class="hljs-meta">... </span>    return_attention_mask=<span class="hljs-literal">True</span>, 
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Since we now generating in batch(2 audios) we must pass the attention_mask</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model_output = model.generate(
<span class="hljs-meta">... </span>    input_features=inputs[<span class="hljs-string">&quot;input_features&quot;</span>],
<span class="hljs-meta">... </span>    attention_mask=inputs[<span class="hljs-string">&quot;attention_mask&quot;</span>],
<span class="hljs-meta">... </span>    composer=<span class="hljs-string">&quot;composer1&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output = tokenizer.batch_decode(
<span class="hljs-meta">... </span>    token_ids=model_output, feature_extractor_output=inputs
<span class="hljs-meta">... </span>)[<span class="hljs-string">&quot;pretty_midi_objects&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Since we now have 2 generated MIDI files</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output[<span class="hljs-number">0</span>].write(<span class="hljs-string">&quot;./Outputs/midi_output1.mid&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_output[<span class="hljs-number">1</span>].write(<span class="hljs-string">&quot;./Outputs/midi_output2.mid&quot;</span>)`}}),Ee=new ye({}),Ie=new V({props:{name:"class transformers.Pop2PianoConfig",anchor:"transformers.Pop2PianoConfig",parameters:[{name:"vocab_size",val:" = 2400"},{name:"composer_vocab_size",val:" = 21"},{name:"d_model",val:" = 512"},{name:"d_kv",val:" = 64"},{name:"d_ff",val:" = 2048"},{name:"num_layers",val:" = 6"},{name:"num_decoder_layers",val:" = None"},{name:"num_heads",val:" = 8"},{name:"relative_attention_num_buckets",val:" = 32"},{name:"relative_attention_max_distance",val:" = 128"},{name:"dropout_rate",val:" = 0.1"},{name:"layer_norm_epsilon",val:" = 1e-06"},{name:"initializer_factor",val:" = 1.0"},{name:"feed_forward_proj",val:" = 'gated-gelu'"},{name:"is_encoder_decoder",val:" = True"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"dense_act_fn",val:" = 'relu'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Pop2PianoConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2400) &#x2014;
Vocabulary size of the <code>Pop2PianoForConditionalGeneration</code> model. Defines the number of different tokens
that can be represented by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/pop2piano#transformers.Pop2PianoForConditionalGeneration">Pop2PianoForConditionalGeneration</a>.`,name:"vocab_size"},{anchor:"transformers.Pop2PianoConfig.composer_vocab_size",description:`<strong>composer_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 21) &#x2014;
Denotes the number of composers.`,name:"composer_vocab_size"},{anchor:"transformers.Pop2PianoConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Size of the encoder layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.Pop2PianoConfig.d_kv",description:`<strong>d_kv</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Size of the key, query, value projections per attention head. The <code>inner_dim</code> of the projection layer will
be defined as <code>num_heads * d_kv</code>.`,name:"d_kv"},{anchor:"transformers.Pop2PianoConfig.d_ff",description:`<strong>d_ff</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Size of the intermediate feed forward layer in each <code>Pop2PianoBlock</code>.`,name:"d_ff"},{anchor:"transformers.Pop2PianoConfig.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_layers"},{anchor:"transformers.Pop2PianoConfig.num_decoder_layers",description:`<strong>num_decoder_layers</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of hidden layers in the Transformer decoder. Will use the same value as <code>num_layers</code> if not set.`,name:"num_decoder_layers"},{anchor:"transformers.Pop2PianoConfig.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.Pop2PianoConfig.relative_attention_num_buckets",description:`<strong>relative_attention_num_buckets</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The number of buckets to use for each attention layer.`,name:"relative_attention_num_buckets"},{anchor:"transformers.Pop2PianoConfig.relative_attention_max_distance",description:`<strong>relative_attention_max_distance</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
The maximum distance of the longer sequences for the bucket separation.`,name:"relative_attention_max_distance"},{anchor:"transformers.Pop2PianoConfig.dropout_rate",description:`<strong>dropout_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The ratio for all dropout layers.`,name:"dropout_rate"},{anchor:"transformers.Pop2PianoConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-6) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_epsilon"},{anchor:"transformers.Pop2PianoConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
A factor for initializing all weight matrices (should be kept to 1.0, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.Pop2PianoConfig.feed_forward_proj",description:`<strong>feed_forward_proj</strong> (<code>string</code>, <em>optional</em>, defaults to <code>&quot;gated-gelu&quot;</code>) &#x2014;
Type of feed forward layer to be used. Should be one of <code>&quot;relu&quot;</code> or <code>&quot;gated-gelu&quot;</code>.`,name:"feed_forward_proj"},{anchor:"transformers.Pop2PianoConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"},{anchor:"transformers.Pop2PianoConfig.dense_act_fn",description:`<strong>dense_act_fn</strong> (<code>string</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
Type of Activation Function to be used in <code>Pop2PianoDenseActDense</code> and in <code>Pop2PianoDenseGatedActDense</code>.`,name:"dense_act_fn"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pop2piano/configuration_pop2piano.py#L29"}}),Ge=new ye({}),$e=new V({props:{name:"class transformers.Pop2PianoFeatureExtractor",anchor:"transformers.Pop2PianoFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L5"}}),ze=new V({props:{name:"__call__",anchor:"transformers.Pop2PianoFeatureExtractor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),Fe=new ye({}),Ze=new V({props:{name:"class transformers.Pop2PianoForConditionalGeneration",anchor:"transformers.Pop2PianoForConditionalGeneration",parameters:[{name:"config",val:": Pop2PianoConfig"}],parametersDescription:[{anchor:"transformers.Pop2PianoForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/pop2piano#transformers.Pop2PianoConfig">Pop2PianoConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pop2piano/modeling_pop2piano.py#L1020"}}),Be=new V({props:{name:"forward",anchor:"transformers.Pop2PianoForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"input_features",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Pop2Piano is a model with relative position embeddings
so you should be able to pad the inputs on both the right and the left. Indices can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for detail.
<a href="../glossary#input-ids">What are input IDs?</a> To know more on how to prepare <code>input_ids</code> for pretraining
take a look a <a href="./Pop2Piano#training">Pop2Pianp Training</a>.`,name:"input_ids"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary. Indices can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.
<a href="../glossary#decoder-input-ids">What are decoder input IDs?</a> Pop2Piano uses the <code>pad_token_id</code> as the
starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code> is used, optionally only the last
<code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>). To know more on how to prepare`,name:"decoder_input_ids"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in
<code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <code>optional</code>: <em>hidden_states</em>, <code>optional</code>: <em>attentions</em>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of hidden states at
the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.input_features",description:`<strong>input_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Does the same task as <code>inputs_embeds</code>. If <code>inputs_embeds</code> is not present but <code>input_features</code> is present
then <code>input_features</code> will be considered as <code>inputs_embeds</code>.`,name:"input_features"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix. If
<code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value of
<code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Pop2PianoForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[-100, 0, ..., config.vocab_size - 1]</code>. All labels set to <code>-100</code> are ignored (masked), the loss is only computed for
labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pop2piano/modeling_pop2piano.py#L1119",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/pop2piano#transformers.Pop2PianoConfig"
>Pop2PianoConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ue=new Ts({props:{$$slots:{default:[Cs]},$$scope:{ctx:Ye}}}),Ve=new V({props:{name:"generate",anchor:"transformers.Pop2PianoForConditionalGeneration.generate",parameters:[{name:"input_features",val:""},{name:"attention_mask",val:" = None"},{name:"composer",val:" = 'composer1'"},{name:"generation_config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Pop2PianoForConditionalGeneration.generate.input_features",description:`<strong>input_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
This is the featurized version of audio generated by <code>Pop2PianoFeatureExtractor</code>.
attention_mask &#x2014;
For batched generation <code>input_features</code> are padded to have the same shape across all examples.
<code>attention_mask</code> helps to determine which areas were padded and which were not.<ul>
<li>1 for tokens that are <strong>not padded</strong>,</li>
<li>0 for tokens that are <strong>padded</strong>.</li>
</ul>`,name:"input_features"},{anchor:"transformers.Pop2PianoForConditionalGeneration.generate.composer",description:`<strong>composer</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;composer1&quot;</code>) &#x2014;
This value is passed to <code>Pop2PianoConcatEmbeddingToMel</code> to generate different embeddings for each
<code>&quot;composer&quot;</code>. Please make sure that the composet value is present in <code>composer_to_feature_token</code> in
<code>generation_config</code>. For an example please see
<a href="https://huggingface.co/sweetcocoa/pop2piano/blob/main/generation_config.json" rel="nofollow">https://huggingface.co/sweetcocoa/pop2piano/blob/main/generation_config.json</a> .`,name:"composer"},{anchor:"transformers.Pop2PianoForConditionalGeneration.generate.generation_config",description:`<strong>generation_config</strong> (<code>~generation.GenerationConfig</code>, <em>optional</em>) &#x2014;
The generation configuration to be used as base parametrization for the generation call. <code>**kwargs</code>
passed to generate matching the attributes of <code>generation_config</code> will override them. If
<code>generation_config</code> is not provided, the default will be used, which had the following loading
priority: 1) from the <code>generation_config.json</code> model file, if it exists; 2) from the model
configuration. Please note that unspecified parameters will inherit <a href="/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationConfig">GenerationConfig</a>&#x2019;s
default values, whose documentation should be checked to parameterize generation.
kwargs &#x2014;
Ad hoc parametrization of <code>generate_config</code> and/or additional model-specific kwargs that will be
forwarded to the <code>forward</code> function of the model. If the model is an encoder-decoder model, encoder
specific kwargs should not be prefixed and decoder specific kwargs should be prefixed with <em>decoder_</em>.`,name:"generation_config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pop2piano/modeling_pop2piano.py#L1227",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput"
>ModelOutput</a> (if <code>return_dict_in_generate=True</code>
or when <code>config.return_dict_in_generate=True</code>) or a <code>torch.FloatTensor</code>.
Since Pop2Piano is an encoder-decoder model (<code>model.config.is_encoder_decoder=True</code>), the possible
<a
  href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput"
>ModelOutput</a> types are:</p>
<ul>
<li><a
  href="/docs/transformers/main/en/internal/generation_utils#transformers.generation.GreedySearchEncoderDecoderOutput"
>GreedySearchEncoderDecoderOutput</a>,</li>
<li><a
  href="/docs/transformers/main/en/internal/generation_utils#transformers.generation.SampleEncoderDecoderOutput"
>SampleEncoderDecoderOutput</a>,</li>
<li><a
  href="/docs/transformers/main/en/internal/generation_utils#transformers.generation.BeamSearchEncoderDecoderOutput"
>BeamSearchEncoderDecoderOutput</a>,</li>
<li><a
  href="/docs/transformers/main/en/internal/generation_utils#transformers.generation.BeamSampleEncoderDecoderOutput"
>BeamSampleEncoderDecoderOutput</a></li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput"
>ModelOutput</a> or <code>torch.LongTensor</code></p>
`}}),me=new Ts({props:{warning:!0,$$slots:{default:[Gs]},$$scope:{ctx:Ye}}}),Re=new ye({}),Ne=new V({props:{name:"class transformers.Pop2PianoTokenizer",anchor:"transformers.Pop2PianoTokenizer",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L12"}}),xe=new V({props:{name:"__call__",anchor:"transformers.Pop2PianoTokenizer.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),qe=new ye({}),Qe=new V({props:{name:"class transformers.Pop2PianoProcessor",anchor:"transformers.Pop2PianoProcessor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L19"}}),Se=new V({props:{name:"__call__",anchor:"transformers.Pop2PianoProcessor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),{c(){m=n("meta"),U=p(),w=n("h1"),M=n("a"),J=n("span"),h(P.$$.fragment),j=p(),E=n("span"),R=r("Pop2Piano"),te=p(),I=n("div"),k=n("a"),$=n("img"),z=p(),v=n("h2"),C=n("a"),ne=n("span"),h(F.$$.fragment),De=p(),wo=n("span"),xt=r("Overview"),Do=p(),ae=n("p"),qt=r("The Pop2Piano model was proposed in "),be=n("a"),Qt=r("Pop2Piano : Pop Audio-based Piano Cover Generation"),St=r(" by Jongho Choi and Kyogu Lee."),Oo=p(),Oe=n("p"),Ht=r(`Piano covers of pop music are widely enjoyed, but generating them from music is not a trivial task. It requires great
expertise with playing piano as well as knowing different characteristics and melodies of a song. With Pop2Piano you
can directly generate a cover from a song\u2019s audio waveform. It is the first model to directly generate a piano cover
from pop audio without melody and chord extraction modules.`),Lo=p(),se=n("p"),Yt=r("Pop2Piano is an encoder-decoder Transformer model based on "),ve=n("a"),At=r("T5"),Dt=r(`. The input audio
is transformed to its waveform and passed to the encoder, which transforms it to a latent representation. The decoder
uses these latent representations to generate token ids in an autoregressive way. Each token id corresponds to one of four
different token types: time, velocity, note and \u2018special\u2019. The token ids are then decoded to their equivalent MIDI file.`),Ko=p(),Le=n("p"),Ot=r("The abstract from the paper is the following:"),et=p(),Ke=n("p"),Po=n("em"),Lt=r(`Piano covers of pop music are enjoyed by many people. However, the
task of automatically generating piano covers of pop music is still
understudied. This is partly due to the lack of synchronized
{Pop, Piano Cover} data pairs, which made it challenging to apply
the latest data-intensive deep learning-based methods. To leverage
the power of the data-driven approach, we make a large amount of
paired and synchronized {Pop, Piano Cover} data using an automated
pipeline. In this paper, we present Pop2Piano, a Transformer network
that generates piano covers given waveforms of pop music. To the best
of our knowledge, this is the first model to generate a piano cover
directly from pop audio without using melody and chord extraction
modules. We show that Pop2Piano, trained with our dataset, is capable
of producing plausible piano covers.`),ot=p(),eo=n("p"),Kt=r("Tips:"),tt=p(),oo=n("ol"),Mo=n("li"),en=r("To use Pop2Piano, you will need to install the \u{1F917} Transformers library, as well as the following third party modules:"),nt=p(),h(we.$$.fragment),at=p(),re=n("p"),on=r(`Please note that you may need to restart your runtime after installation.
2. Pop2Piano is an Encoder-Decoder based model like T5.
3. Pop2Piano can be used to generate midi-audio files for a given audio sequence.
4. Choosing different composers in `),To=n("code"),tn=r("Pop2PianoForConditionalGeneration.generate()"),nn=r(` can lead to variety of different results.
5. Setting the sampling rate to 44.1 kHz when loading the audio file can give good performance.
6. Though Pop2Piano was mainly trained on Korean Pop music, it also does pretty well on other Western Pop or Hip Hop songs.`),st=p(),Z=n("p"),an=r("This model was contributed by "),Pe=n("a"),sn=r("Susnato Dhar"),rn=r(`.
The original code can be found `),Me=n("a"),ln=r("here"),dn=r("."),rt=p(),N=n("h2"),ie=n("a"),jo=n("span"),h(Te.$$.fragment),cn=p(),Jo=n("span"),pn=r("Examples"),it=p(),to=n("ul"),ko=n("li"),un=r("Example using HuggingFace Dataset:"),lt=p(),h(je.$$.fragment),dt=p(),no=n("ul"),Uo=n("li"),mn=r("Example using your own audio file:"),ct=p(),h(Je.$$.fragment),pt=p(),ao=n("ul"),Eo=n("li"),hn=r("Example of processing multiple audio files in batch:"),ut=p(),h(ke.$$.fragment),mt=p(),so=n("ul"),x=n("li"),fn=r("Example of processing multiple audio files in batch (Using "),Io=n("code"),gn=r("Pop2PianoFeatureExtractor"),_n=r(" and "),Co=n("code"),yn=r("Pop2PianoTokenizer"),bn=r("):"),ht=p(),h(Ue.$$.fragment),ft=p(),q=n("h2"),le=n("a"),Go=n("span"),h(Ee.$$.fragment),vn=p(),$o=n("span"),wn=r("Pop2PianoConfig"),gt=p(),G=n("div"),h(Ie.$$.fragment),Pn=p(),Q=n("p"),Mn=r("This is the configuration class to store the configuration of a "),ro=n("a"),Tn=r("Pop2PianoForConditionalGeneration"),jn=r(`. It is used
to instantiate a Pop2PianoForConditionalGeneration model according to the specified arguments, defining the model
architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the
Pop2Piano `),Ce=n("a"),Jn=r("sweetcocoa/pop2piano"),kn=r(" architecture."),Un=p(),S=n("p"),En=r("Configuration objects inherit from "),io=n("a"),In=r("PretrainedConfig"),Cn=r(` and can be used to control the model outputs. Read the
documentation from `),lo=n("a"),Gn=r("PretrainedConfig"),$n=r(" for more information."),_t=p(),H=n("h2"),de=n("a"),zo=n("span"),h(Ge.$$.fragment),zn=p(),Fo=n("span"),Fn=r("Pop2PianoFeatureExtractor"),yt=p(),Y=n("div"),h($e.$$.fragment),Zn=p(),ce=n("div"),h(ze.$$.fragment),Xn=p(),Zo=n("p"),Wn=r("Call self as a function."),bt=p(),A=n("h2"),pe=n("a"),Xo=n("span"),h(Fe.$$.fragment),Bn=p(),Wo=n("span"),Vn=r("Pop2PianoForConditionalGeneration"),vt=p(),T=n("div"),h(Ze.$$.fragment),Rn=p(),D=n("p"),Nn=r("Pop2Piano Model with a "),Bo=n("code"),xn=r("language modeling"),qn=r(` head on top.
This model inherits from `),co=n("a"),Qn=r("PreTrainedModel"),Sn=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Hn=p(),Xe=n("p"),Yn=r("This model is also a PyTorch "),We=n("a"),An=r("torch.nn.Module"),Dn=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),On=p(),X=n("div"),h(Be.$$.fragment),Ln=p(),O=n("p"),Kn=r("The "),po=n("a"),ea=r("Pop2PianoForConditionalGeneration"),oa=r(" forward method, overrides the "),Vo=n("code"),ta=r("__call__"),na=r(" special method."),aa=p(),h(ue.$$.fragment),sa=p(),W=n("div"),h(Ve.$$.fragment),ra=p(),Ro=n("p"),ia=r("Generates token ids for midi outputs."),la=p(),h(me.$$.fragment),wt=p(),L=n("h2"),he=n("a"),No=n("span"),h(Re.$$.fragment),da=p(),xo=n("span"),ca=r("Pop2PianoTokenizer"),Pt=p(),K=n("div"),h(Ne.$$.fragment),pa=p(),fe=n("div"),h(xe.$$.fragment),ua=p(),qo=n("p"),ma=r("Call self as a function."),Mt=p(),ee=n("h2"),ge=n("a"),Qo=n("span"),h(qe.$$.fragment),ha=p(),So=n("span"),fa=r("Pop2PianoProcessor"),Tt=p(),oe=n("div"),h(Qe.$$.fragment),ga=p(),_e=n("div"),h(Se.$$.fragment),_a=p(),Ho=n("p"),ya=r("Call self as a function."),this.h()},l(e){const l=Us('[data-svelte="svelte-1phssyn"]',document.head);m=a(l,"META",{name:!0,content:!0}),l.forEach(t),U=u(e),w=a(e,"H1",{class:!0});var He=s(w);M=a(He,"A",{id:!0,class:!0,href:!0});var Yo=s(M);J=a(Yo,"SPAN",{});var ba=s(J);f(P.$$.fragment,ba),ba.forEach(t),Yo.forEach(t),j=u(He),E=a(He,"SPAN",{});var va=s(E);R=i(va,"Pop2Piano"),va.forEach(t),He.forEach(t),te=u(e),I=a(e,"DIV",{class:!0});var wa=s(I);k=a(wa,"A",{href:!0});var Pa=s(k);$=a(Pa,"IMG",{alt:!0,src:!0}),Pa.forEach(t),wa.forEach(t),z=u(e),v=a(e,"H2",{class:!0});var Jt=s(v);C=a(Jt,"A",{id:!0,class:!0,href:!0});var Ma=s(C);ne=a(Ma,"SPAN",{});var Ta=s(ne);f(F.$$.fragment,Ta),Ta.forEach(t),Ma.forEach(t),De=u(Jt),wo=a(Jt,"SPAN",{});var ja=s(wo);xt=i(ja,"Overview"),ja.forEach(t),Jt.forEach(t),Do=u(e),ae=a(e,"P",{});var kt=s(ae);qt=i(kt,"The Pop2Piano model was proposed in "),be=a(kt,"A",{href:!0,rel:!0});var Ja=s(be);Qt=i(Ja,"Pop2Piano : Pop Audio-based Piano Cover Generation"),Ja.forEach(t),St=i(kt," by Jongho Choi and Kyogu Lee."),kt.forEach(t),Oo=u(e),Oe=a(e,"P",{});var ka=s(Oe);Ht=i(ka,`Piano covers of pop music are widely enjoyed, but generating them from music is not a trivial task. It requires great
expertise with playing piano as well as knowing different characteristics and melodies of a song. With Pop2Piano you
can directly generate a cover from a song\u2019s audio waveform. It is the first model to directly generate a piano cover
from pop audio without melody and chord extraction modules.`),ka.forEach(t),Lo=u(e),se=a(e,"P",{});var Ut=s(se);Yt=i(Ut,"Pop2Piano is an encoder-decoder Transformer model based on "),ve=a(Ut,"A",{href:!0,rel:!0});var Ua=s(ve);At=i(Ua,"T5"),Ua.forEach(t),Dt=i(Ut,`. The input audio
is transformed to its waveform and passed to the encoder, which transforms it to a latent representation. The decoder
uses these latent representations to generate token ids in an autoregressive way. Each token id corresponds to one of four
different token types: time, velocity, note and \u2018special\u2019. The token ids are then decoded to their equivalent MIDI file.`),Ut.forEach(t),Ko=u(e),Le=a(e,"P",{});var Ea=s(Le);Ot=i(Ea,"The abstract from the paper is the following:"),Ea.forEach(t),et=u(e),Ke=a(e,"P",{});var Ia=s(Ke);Po=a(Ia,"EM",{});var Ca=s(Po);Lt=i(Ca,`Piano covers of pop music are enjoyed by many people. However, the
task of automatically generating piano covers of pop music is still
understudied. This is partly due to the lack of synchronized
{Pop, Piano Cover} data pairs, which made it challenging to apply
the latest data-intensive deep learning-based methods. To leverage
the power of the data-driven approach, we make a large amount of
paired and synchronized {Pop, Piano Cover} data using an automated
pipeline. In this paper, we present Pop2Piano, a Transformer network
that generates piano covers given waveforms of pop music. To the best
of our knowledge, this is the first model to generate a piano cover
directly from pop audio without using melody and chord extraction
modules. We show that Pop2Piano, trained with our dataset, is capable
of producing plausible piano covers.`),Ca.forEach(t),Ia.forEach(t),ot=u(e),eo=a(e,"P",{});var Ga=s(eo);Kt=i(Ga,"Tips:"),Ga.forEach(t),tt=u(e),oo=a(e,"OL",{});var $a=s(oo);Mo=a($a,"LI",{});var za=s(Mo);en=i(za,"To use Pop2Piano, you will need to install the \u{1F917} Transformers library, as well as the following third party modules:"),za.forEach(t),$a.forEach(t),nt=u(e),f(we.$$.fragment,e),at=u(e),re=a(e,"P",{});var Et=s(re);on=i(Et,`Please note that you may need to restart your runtime after installation.
2. Pop2Piano is an Encoder-Decoder based model like T5.
3. Pop2Piano can be used to generate midi-audio files for a given audio sequence.
4. Choosing different composers in `),To=a(Et,"CODE",{});var Fa=s(To);tn=i(Fa,"Pop2PianoForConditionalGeneration.generate()"),Fa.forEach(t),nn=i(Et,` can lead to variety of different results.
5. Setting the sampling rate to 44.1 kHz when loading the audio file can give good performance.
6. Though Pop2Piano was mainly trained on Korean Pop music, it also does pretty well on other Western Pop or Hip Hop songs.`),Et.forEach(t),st=u(e),Z=a(e,"P",{});var uo=s(Z);an=i(uo,"This model was contributed by "),Pe=a(uo,"A",{href:!0,rel:!0});var Za=s(Pe);sn=i(Za,"Susnato Dhar"),Za.forEach(t),rn=i(uo,`.
The original code can be found `),Me=a(uo,"A",{href:!0,rel:!0});var Xa=s(Me);ln=i(Xa,"here"),Xa.forEach(t),dn=i(uo,"."),uo.forEach(t),rt=u(e),N=a(e,"H2",{class:!0});var It=s(N);ie=a(It,"A",{id:!0,class:!0,href:!0});var Wa=s(ie);jo=a(Wa,"SPAN",{});var Ba=s(jo);f(Te.$$.fragment,Ba),Ba.forEach(t),Wa.forEach(t),cn=u(It),Jo=a(It,"SPAN",{});var Va=s(Jo);pn=i(Va,"Examples"),Va.forEach(t),It.forEach(t),it=u(e),to=a(e,"UL",{});var Ra=s(to);ko=a(Ra,"LI",{});var Na=s(ko);un=i(Na,"Example using HuggingFace Dataset:"),Na.forEach(t),Ra.forEach(t),lt=u(e),f(je.$$.fragment,e),dt=u(e),no=a(e,"UL",{});var xa=s(no);Uo=a(xa,"LI",{});var qa=s(Uo);mn=i(qa,"Example using your own audio file:"),qa.forEach(t),xa.forEach(t),ct=u(e),f(Je.$$.fragment,e),pt=u(e),ao=a(e,"UL",{});var Qa=s(ao);Eo=a(Qa,"LI",{});var Sa=s(Eo);hn=i(Sa,"Example of processing multiple audio files in batch:"),Sa.forEach(t),Qa.forEach(t),ut=u(e),f(ke.$$.fragment,e),mt=u(e),so=a(e,"UL",{});var Ha=s(so);x=a(Ha,"LI",{});var mo=s(x);fn=i(mo,"Example of processing multiple audio files in batch (Using "),Io=a(mo,"CODE",{});var Ya=s(Io);gn=i(Ya,"Pop2PianoFeatureExtractor"),Ya.forEach(t),_n=i(mo," and "),Co=a(mo,"CODE",{});var Aa=s(Co);yn=i(Aa,"Pop2PianoTokenizer"),Aa.forEach(t),bn=i(mo,"):"),mo.forEach(t),Ha.forEach(t),ht=u(e),f(Ue.$$.fragment,e),ft=u(e),q=a(e,"H2",{class:!0});var Ct=s(q);le=a(Ct,"A",{id:!0,class:!0,href:!0});var Da=s(le);Go=a(Da,"SPAN",{});var Oa=s(Go);f(Ee.$$.fragment,Oa),Oa.forEach(t),Da.forEach(t),vn=u(Ct),$o=a(Ct,"SPAN",{});var La=s($o);wn=i(La,"Pop2PianoConfig"),La.forEach(t),Ct.forEach(t),gt=u(e),G=a(e,"DIV",{class:!0});var ho=s(G);f(Ie.$$.fragment,ho),Pn=u(ho),Q=a(ho,"P",{});var fo=s(Q);Mn=i(fo,"This is the configuration class to store the configuration of a "),ro=a(fo,"A",{href:!0});var Ka=s(ro);Tn=i(Ka,"Pop2PianoForConditionalGeneration"),Ka.forEach(t),jn=i(fo,`. It is used
to instantiate a Pop2PianoForConditionalGeneration model according to the specified arguments, defining the model
architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the
Pop2Piano `),Ce=a(fo,"A",{href:!0,rel:!0});var es=s(Ce);Jn=i(es,"sweetcocoa/pop2piano"),es.forEach(t),kn=i(fo," architecture."),fo.forEach(t),Un=u(ho),S=a(ho,"P",{});var go=s(S);En=i(go,"Configuration objects inherit from "),io=a(go,"A",{href:!0});var os=s(io);In=i(os,"PretrainedConfig"),os.forEach(t),Cn=i(go,` and can be used to control the model outputs. Read the
documentation from `),lo=a(go,"A",{href:!0});var ts=s(lo);Gn=i(ts,"PretrainedConfig"),ts.forEach(t),$n=i(go," for more information."),go.forEach(t),ho.forEach(t),_t=u(e),H=a(e,"H2",{class:!0});var Gt=s(H);de=a(Gt,"A",{id:!0,class:!0,href:!0});var ns=s(de);zo=a(ns,"SPAN",{});var as=s(zo);f(Ge.$$.fragment,as),as.forEach(t),ns.forEach(t),zn=u(Gt),Fo=a(Gt,"SPAN",{});var ss=s(Fo);Fn=i(ss,"Pop2PianoFeatureExtractor"),ss.forEach(t),Gt.forEach(t),yt=u(e),Y=a(e,"DIV",{class:!0});var $t=s(Y);f($e.$$.fragment,$t),Zn=u($t),ce=a($t,"DIV",{class:!0});var zt=s(ce);f(ze.$$.fragment,zt),Xn=u(zt),Zo=a(zt,"P",{});var rs=s(Zo);Wn=i(rs,"Call self as a function."),rs.forEach(t),zt.forEach(t),$t.forEach(t),bt=u(e),A=a(e,"H2",{class:!0});var Ft=s(A);pe=a(Ft,"A",{id:!0,class:!0,href:!0});var is=s(pe);Xo=a(is,"SPAN",{});var ls=s(Xo);f(Fe.$$.fragment,ls),ls.forEach(t),is.forEach(t),Bn=u(Ft),Wo=a(Ft,"SPAN",{});var ds=s(Wo);Vn=i(ds,"Pop2PianoForConditionalGeneration"),ds.forEach(t),Ft.forEach(t),vt=u(e),T=a(e,"DIV",{class:!0});var B=s(T);f(Ze.$$.fragment,B),Rn=u(B),D=a(B,"P",{});var _o=s(D);Nn=i(_o,"Pop2Piano Model with a "),Bo=a(_o,"CODE",{});var cs=s(Bo);xn=i(cs,"language modeling"),cs.forEach(t),qn=i(_o,` head on top.
This model inherits from `),co=a(_o,"A",{href:!0});var ps=s(co);Qn=i(ps,"PreTrainedModel"),ps.forEach(t),Sn=i(_o,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_o.forEach(t),Hn=u(B),Xe=a(B,"P",{});var Zt=s(Xe);Yn=i(Zt,"This model is also a PyTorch "),We=a(Zt,"A",{href:!0,rel:!0});var us=s(We);An=i(us,"torch.nn.Module"),us.forEach(t),Dn=i(Zt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zt.forEach(t),On=u(B),X=a(B,"DIV",{class:!0});var yo=s(X);f(Be.$$.fragment,yo),Ln=u(yo),O=a(yo,"P",{});var bo=s(O);Kn=i(bo,"The "),po=a(bo,"A",{href:!0});var ms=s(po);ea=i(ms,"Pop2PianoForConditionalGeneration"),ms.forEach(t),oa=i(bo," forward method, overrides the "),Vo=a(bo,"CODE",{});var hs=s(Vo);ta=i(hs,"__call__"),hs.forEach(t),na=i(bo," special method."),bo.forEach(t),aa=u(yo),f(ue.$$.fragment,yo),yo.forEach(t),sa=u(B),W=a(B,"DIV",{class:!0});var vo=s(W);f(Ve.$$.fragment,vo),ra=u(vo),Ro=a(vo,"P",{});var fs=s(Ro);ia=i(fs,"Generates token ids for midi outputs."),fs.forEach(t),la=u(vo),f(me.$$.fragment,vo),vo.forEach(t),B.forEach(t),wt=u(e),L=a(e,"H2",{class:!0});var Xt=s(L);he=a(Xt,"A",{id:!0,class:!0,href:!0});var gs=s(he);No=a(gs,"SPAN",{});var _s=s(No);f(Re.$$.fragment,_s),_s.forEach(t),gs.forEach(t),da=u(Xt),xo=a(Xt,"SPAN",{});var ys=s(xo);ca=i(ys,"Pop2PianoTokenizer"),ys.forEach(t),Xt.forEach(t),Pt=u(e),K=a(e,"DIV",{class:!0});var Wt=s(K);f(Ne.$$.fragment,Wt),pa=u(Wt),fe=a(Wt,"DIV",{class:!0});var Bt=s(fe);f(xe.$$.fragment,Bt),ua=u(Bt),qo=a(Bt,"P",{});var bs=s(qo);ma=i(bs,"Call self as a function."),bs.forEach(t),Bt.forEach(t),Wt.forEach(t),Mt=u(e),ee=a(e,"H2",{class:!0});var Vt=s(ee);ge=a(Vt,"A",{id:!0,class:!0,href:!0});var vs=s(ge);Qo=a(vs,"SPAN",{});var ws=s(Qo);f(qe.$$.fragment,ws),ws.forEach(t),vs.forEach(t),ha=u(Vt),So=a(Vt,"SPAN",{});var Ps=s(So);fa=i(Ps,"Pop2PianoProcessor"),Ps.forEach(t),Vt.forEach(t),Tt=u(e),oe=a(e,"DIV",{class:!0});var Rt=s(oe);f(Qe.$$.fragment,Rt),ga=u(Rt),_e=a(Rt,"DIV",{class:!0});var Nt=s(_e);f(Se.$$.fragment,Nt),_a=u(Nt),Ho=a(Nt,"P",{});var Ms=s(Ho);ya=i(Ms,"Call self as a function."),Ms.forEach(t),Nt.forEach(t),Rt.forEach(t),this.h()},h(){d(m,"name","hf:doc:metadata"),d(m,"content",JSON.stringify(zs)),d(M,"id","pop2piano"),d(M,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(M,"href","#pop2piano"),d(w,"class","relative group"),d($,"alt","Spaces"),Es($.src,Ae="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||d($,"src",Ae),d(k,"href","https://huggingface.co/spaces/sweetcocoa/pop2piano"),d(I,"class","flex flex-wrap space-x-1"),d(C,"id","overview"),d(C,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(C,"href","#overview"),d(v,"class","relative group"),d(be,"href","https://arxiv.org/abs/2211.00895"),d(be,"rel","nofollow"),d(ve,"href","https://arxiv.org/pdf/1910.10683.pdf"),d(ve,"rel","nofollow"),d(Pe,"href","https://huggingface.co/susnato"),d(Pe,"rel","nofollow"),d(Me,"href","https://github.com/sweetcocoa/pop2piano"),d(Me,"rel","nofollow"),d(ie,"id","examples"),d(ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ie,"href","#examples"),d(N,"class","relative group"),d(le,"id","transformers.Pop2PianoConfig"),d(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(le,"href","#transformers.Pop2PianoConfig"),d(q,"class","relative group"),d(ro,"href","/docs/transformers/main/en/model_doc/pop2piano#transformers.Pop2PianoForConditionalGeneration"),d(Ce,"href","https://huggingface.co/sweetcocoa/pop2piano"),d(Ce,"rel","nofollow"),d(io,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(lo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(de,"id","transformers.Pop2PianoFeatureExtractor"),d(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(de,"href","#transformers.Pop2PianoFeatureExtractor"),d(H,"class","relative group"),d(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pe,"id","transformers.Pop2PianoForConditionalGeneration"),d(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(pe,"href","#transformers.Pop2PianoForConditionalGeneration"),d(A,"class","relative group"),d(co,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(We,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(We,"rel","nofollow"),d(po,"href","/docs/transformers/main/en/model_doc/pop2piano#transformers.Pop2PianoForConditionalGeneration"),d(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(he,"id","transformers.Pop2PianoTokenizer"),d(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(he,"href","#transformers.Pop2PianoTokenizer"),d(L,"class","relative group"),d(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ge,"id","transformers.Pop2PianoProcessor"),d(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ge,"href","#transformers.Pop2PianoProcessor"),d(ee,"class","relative group"),d(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,l){o(document.head,m),c(e,U,l),c(e,w,l),o(w,M),o(M,J),g(P,J,null),o(w,j),o(w,E),o(E,R),c(e,te,l),c(e,I,l),o(I,k),o(k,$),c(e,z,l),c(e,v,l),o(v,C),o(C,ne),g(F,ne,null),o(v,De),o(v,wo),o(wo,xt),c(e,Do,l),c(e,ae,l),o(ae,qt),o(ae,be),o(be,Qt),o(ae,St),c(e,Oo,l),c(e,Oe,l),o(Oe,Ht),c(e,Lo,l),c(e,se,l),o(se,Yt),o(se,ve),o(ve,At),o(se,Dt),c(e,Ko,l),c(e,Le,l),o(Le,Ot),c(e,et,l),c(e,Ke,l),o(Ke,Po),o(Po,Lt),c(e,ot,l),c(e,eo,l),o(eo,Kt),c(e,tt,l),c(e,oo,l),o(oo,Mo),o(Mo,en),c(e,nt,l),g(we,e,l),c(e,at,l),c(e,re,l),o(re,on),o(re,To),o(To,tn),o(re,nn),c(e,st,l),c(e,Z,l),o(Z,an),o(Z,Pe),o(Pe,sn),o(Z,rn),o(Z,Me),o(Me,ln),o(Z,dn),c(e,rt,l),c(e,N,l),o(N,ie),o(ie,jo),g(Te,jo,null),o(N,cn),o(N,Jo),o(Jo,pn),c(e,it,l),c(e,to,l),o(to,ko),o(ko,un),c(e,lt,l),g(je,e,l),c(e,dt,l),c(e,no,l),o(no,Uo),o(Uo,mn),c(e,ct,l),g(Je,e,l),c(e,pt,l),c(e,ao,l),o(ao,Eo),o(Eo,hn),c(e,ut,l),g(ke,e,l),c(e,mt,l),c(e,so,l),o(so,x),o(x,fn),o(x,Io),o(Io,gn),o(x,_n),o(x,Co),o(Co,yn),o(x,bn),c(e,ht,l),g(Ue,e,l),c(e,ft,l),c(e,q,l),o(q,le),o(le,Go),g(Ee,Go,null),o(q,vn),o(q,$o),o($o,wn),c(e,gt,l),c(e,G,l),g(Ie,G,null),o(G,Pn),o(G,Q),o(Q,Mn),o(Q,ro),o(ro,Tn),o(Q,jn),o(Q,Ce),o(Ce,Jn),o(Q,kn),o(G,Un),o(G,S),o(S,En),o(S,io),o(io,In),o(S,Cn),o(S,lo),o(lo,Gn),o(S,$n),c(e,_t,l),c(e,H,l),o(H,de),o(de,zo),g(Ge,zo,null),o(H,zn),o(H,Fo),o(Fo,Fn),c(e,yt,l),c(e,Y,l),g($e,Y,null),o(Y,Zn),o(Y,ce),g(ze,ce,null),o(ce,Xn),o(ce,Zo),o(Zo,Wn),c(e,bt,l),c(e,A,l),o(A,pe),o(pe,Xo),g(Fe,Xo,null),o(A,Bn),o(A,Wo),o(Wo,Vn),c(e,vt,l),c(e,T,l),g(Ze,T,null),o(T,Rn),o(T,D),o(D,Nn),o(D,Bo),o(Bo,xn),o(D,qn),o(D,co),o(co,Qn),o(D,Sn),o(T,Hn),o(T,Xe),o(Xe,Yn),o(Xe,We),o(We,An),o(Xe,Dn),o(T,On),o(T,X),g(Be,X,null),o(X,Ln),o(X,O),o(O,Kn),o(O,po),o(po,ea),o(O,oa),o(O,Vo),o(Vo,ta),o(O,na),o(X,aa),g(ue,X,null),o(T,sa),o(T,W),g(Ve,W,null),o(W,ra),o(W,Ro),o(Ro,ia),o(W,la),g(me,W,null),c(e,wt,l),c(e,L,l),o(L,he),o(he,No),g(Re,No,null),o(L,da),o(L,xo),o(xo,ca),c(e,Pt,l),c(e,K,l),g(Ne,K,null),o(K,pa),o(K,fe),g(xe,fe,null),o(fe,ua),o(fe,qo),o(qo,ma),c(e,Mt,l),c(e,ee,l),o(ee,ge),o(ge,Qo),g(qe,Qo,null),o(ee,ha),o(ee,So),o(So,fa),c(e,Tt,l),c(e,oe,l),g(Qe,oe,null),o(oe,ga),o(oe,_e),g(Se,_e,null),o(_e,_a),o(_e,Ho),o(Ho,ya),jt=!0},p(e,[l]){const He={};l&2&&(He.$$scope={dirty:l,ctx:e}),ue.$set(He);const Yo={};l&2&&(Yo.$$scope={dirty:l,ctx:e}),me.$set(Yo)},i(e){jt||(_(P.$$.fragment,e),_(F.$$.fragment,e),_(we.$$.fragment,e),_(Te.$$.fragment,e),_(je.$$.fragment,e),_(Je.$$.fragment,e),_(ke.$$.fragment,e),_(Ue.$$.fragment,e),_(Ee.$$.fragment,e),_(Ie.$$.fragment,e),_(Ge.$$.fragment,e),_($e.$$.fragment,e),_(ze.$$.fragment,e),_(Fe.$$.fragment,e),_(Ze.$$.fragment,e),_(Be.$$.fragment,e),_(ue.$$.fragment,e),_(Ve.$$.fragment,e),_(me.$$.fragment,e),_(Re.$$.fragment,e),_(Ne.$$.fragment,e),_(xe.$$.fragment,e),_(qe.$$.fragment,e),_(Qe.$$.fragment,e),_(Se.$$.fragment,e),jt=!0)},o(e){y(P.$$.fragment,e),y(F.$$.fragment,e),y(we.$$.fragment,e),y(Te.$$.fragment,e),y(je.$$.fragment,e),y(Je.$$.fragment,e),y(ke.$$.fragment,e),y(Ue.$$.fragment,e),y(Ee.$$.fragment,e),y(Ie.$$.fragment,e),y(Ge.$$.fragment,e),y($e.$$.fragment,e),y(ze.$$.fragment,e),y(Fe.$$.fragment,e),y(Ze.$$.fragment,e),y(Be.$$.fragment,e),y(ue.$$.fragment,e),y(Ve.$$.fragment,e),y(me.$$.fragment,e),y(Re.$$.fragment,e),y(Ne.$$.fragment,e),y(xe.$$.fragment,e),y(qe.$$.fragment,e),y(Qe.$$.fragment,e),y(Se.$$.fragment,e),jt=!1},d(e){t(m),e&&t(U),e&&t(w),b(P),e&&t(te),e&&t(I),e&&t(z),e&&t(v),b(F),e&&t(Do),e&&t(ae),e&&t(Oo),e&&t(Oe),e&&t(Lo),e&&t(se),e&&t(Ko),e&&t(Le),e&&t(et),e&&t(Ke),e&&t(ot),e&&t(eo),e&&t(tt),e&&t(oo),e&&t(nt),b(we,e),e&&t(at),e&&t(re),e&&t(st),e&&t(Z),e&&t(rt),e&&t(N),b(Te),e&&t(it),e&&t(to),e&&t(lt),b(je,e),e&&t(dt),e&&t(no),e&&t(ct),b(Je,e),e&&t(pt),e&&t(ao),e&&t(ut),b(ke,e),e&&t(mt),e&&t(so),e&&t(ht),b(Ue,e),e&&t(ft),e&&t(q),b(Ee),e&&t(gt),e&&t(G),b(Ie),e&&t(_t),e&&t(H),b(Ge),e&&t(yt),e&&t(Y),b($e),b(ze),e&&t(bt),e&&t(A),b(Fe),e&&t(vt),e&&t(T),b(Ze),b(Be),b(ue),b(Ve),b(me),e&&t(wt),e&&t(L),b(Re),e&&t(Pt),e&&t(K),b(Ne),b(xe),e&&t(Mt),e&&t(ee),b(qe),e&&t(Tt),e&&t(oe),b(Qe),b(Se)}}}const zs={local:"pop2piano",sections:[{local:"overview",title:"Overview"},{local:"examples",title:"Examples"},{local:"transformers.Pop2PianoConfig",title:"Pop2PianoConfig"},{local:"transformers.Pop2PianoFeatureExtractor",title:"Pop2PianoFeatureExtractor"},{local:"transformers.Pop2PianoForConditionalGeneration",title:"Pop2PianoForConditionalGeneration"},{local:"transformers.Pop2PianoTokenizer",title:"Pop2PianoTokenizer"},{local:"transformers.Pop2PianoProcessor",title:"Pop2PianoProcessor"}],title:"Pop2Piano"};function Fs(Ye){return Is(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rs extends js{constructor(m){super();Js(this,m,Fs,$s,ks,{})}}export{Rs as default,zs as metadata};
