import{s as kn,o as Un,n as Jn}from"../chunks/scheduler.9bc65507.js";import{S as Cn,i as $n,g as n,s as i,u as m,A as xn,h as a,f as t,c as l,j as c,v as h,y as p,k as d,o as r,a as s,w as f,d as g,t as _,x as y}from"../chunks/index.78c82d43.js";import{T as jn}from"../chunks/Tip.87d55b76.js";import{D as J}from"../chunks/Docstring.4e7352e2.js";import{C as ht}from"../chunks/CodeBlock.73e038be.js";import{I as K}from"../chunks/IconCopyLink.bedaa44d.js";function Gn(Xe){let u,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){u=n("p"),u.innerHTML=M},l(v){u=a(v,"P",{"data-svelte-h":!0}),p(u)!=="svelte-fincs2"&&(u.innerHTML=M)},m(v,B){s(v,u,B)},p:Jn,d(v){v&&t(u)}}}function In(Xe){let u,M=`Most generation-controlling parameters are set in <code>generation_config</code> which, if not passed, will be set to the
model’s default generation configuration. You can override any <code>generation_config</code> by passing the corresponding
parameters to generate(), e.g. <code>.generate(inputs, num_beams=4, do_sample=True)</code>. For an overview of generation
strategies and code examples, check out the <a href="./generation_strategies">following guide</a>.`;return{c(){u=n("p"),u.innerHTML=M},l(v){u=a(v,"P",{"data-svelte-h":!0}),p(u)!=="svelte-mxjg2r"&&(u.innerHTML=M)},m(v,B){s(v,u,B)},p:Jn,d(v){v&&t(u)}}}function zn(Xe){let u,M,v,B,k,W,at,ee,io,Be,Go="Pop2Piano",ft,V,Io='<a href="https://huggingface.co/spaces/sweetcocoa/pop2piano"><img alt="Spaces" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue"/></a>',gt,U,R,st,te,lo,We,zo="Overview",_t,oe,Zo='The Pop2Piano model was proposed in <a href="https://arxiv.org/abs/2211.00895" rel="nofollow">Pop2Piano : Pop Audio-based Piano Cover Generation</a> by Jongho Choi and Kyogu Lee.',yt,ne,Fo=`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’s audio waveform. It is the first model to directly generate a piano cover
from pop audio without melody and chord extraction modules.`,vt,ae,Xo=`Pop2Piano is an encoder-decoder Transformer model based on <a href="https://arxiv.org/pdf/1910.10683.pdf" rel="nofollow">T5</a>. 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 ‘special’. The token ids are then decoded to their equivalent MIDI file.`,bt,se,Bo="The abstract from the paper is the following:",wt,re,Wo=`<em>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.</em>`,Mt,ie,Vo="Tips:",Tt,le,Ro="<li>To use Pop2Piano, you will need to install the 🤗 Transformers library, as well as the following third party modules:</li>",Pt,de,jt,ce,No=`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 <code>Pop2PianoForConditionalGeneration.generate()</code> 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.`,Jt,pe,Eo=`This model was contributed by <a href="https://huggingface.co/susnato" rel="nofollow">Susnato Dhar</a>.
The original code can be found <a href="https://github.com/sweetcocoa/pop2piano" rel="nofollow">here</a>.`,kt,C,N,rt,ue,co,Ve,Ho="Examples",Ut,me,qo="<li>Example using HuggingFace Dataset:</li>",Ct,he,$t,fe,Qo="<li>Example using your own audio file:</li>",xt,ge,Gt,_e,So="<li>Example of processing multiple audio files in batch:</li>",It,ye,zt,ve,Yo="<li>Example of processing multiple audio files in batch (Using <code>Pop2PianoFeatureExtractor</code> and <code>Pop2PianoTokenizer</code>):</li>",Zt,be,Ft,$,E,it,we,po,Re,Ao="Pop2PianoConfig",Xt,w,Me,uo,Ne,Lo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/pop2piano#transformers.Pop2PianoForConditionalGeneration">Pop2PianoForConditionalGeneration</a>. 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 <a href="https://huggingface.co/sweetcocoa/pop2piano" rel="nofollow">sweetcocoa/pop2piano</a> architecture.`,mo,Ee,Do=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Bt,x,H,lt,Te,ho,He,Oo="Pop2PianoFeatureExtractor",Wt,G,Pe,fo,q,je,go,qe,Ko="Call self as a function.",Vt,I,Q,dt,Je,_o,Qe,en="Pop2PianoForConditionalGeneration",Rt,b,ke,yo,Se,tn=`Pop2Piano Model with a <code>language modeling</code> head on top.
This model inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,vo,Ye,on=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,bo,T,Ue,wo,Ae,nn='The <a href="/docs/transformers/v4.34.0/en/model_doc/pop2piano#transformers.Pop2PianoForConditionalGeneration">Pop2PianoForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',Mo,S,To,P,Ce,Po,Le,an="Generates token ids for midi outputs.",jo,Y,Nt,z,A,ct,$e,Jo,De,sn="Pop2PianoTokenizer",Et,Z,xe,ko,L,Ge,Uo,Oe,rn="Call self as a function.",Ht,F,D,pt,Ie,Co,Ke,ln="Pop2PianoProcessor",qt,X,ze,$o,O,Ze,xo,et,dn="Call self as a function.",Qt,ut,St;return ee=new K({}),te=new K({}),de=new ht({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',wrap:!1}}),ue=new K({}),he=new ht({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>)`,wrap:!1}}),ge=new ht({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>)`,wrap:!1}}),ye=new ht({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>)`,wrap:!1}}),be=new ht({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>)`,wrap:!1}}),we=new K({}),Me=new J({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/v4.34.0/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/v4.34.0/src/transformers/models/pop2piano/configuration_pop2piano.py#L29"}}),Te=new K({}),Pe=new J({props:{name:"class transformers.Pop2PianoFeatureExtractor",anchor:"transformers.Pop2PianoFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L5"}}),je=new J({props:{name:"__call__",anchor:"transformers.Pop2PianoFeatureExtractor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),Je=new K({}),ke=new J({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/v4.34.0/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/v4.34.0/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/v4.34.0/src/transformers/models/pop2piano/modeling_pop2piano.py#L1020"}}),Ue=new J({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/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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/v4.34.0/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/v4.34.0/src/transformers/models/pop2piano/modeling_pop2piano.py#L1119",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/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/v4.34.0/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) — 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>) — 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>) — 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>) — 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>) — 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>) — 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’s 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>) — 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>) — 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>) — 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/v4.34.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),S=new jn({props:{$$slots:{default:[Gn]},$$scope:{ctx:Xe}}}),Ce=new J({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/v4.34.0/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/v4.34.0/src/transformers/models/pop2piano/modeling_pop2piano.py#L1227",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/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/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput"
>ModelOutput</a> types are:</p>
<ul>
<li><a
  href="/docs/transformers/v4.34.0/en/internal/generation_utils#transformers.generation.GreedySearchEncoderDecoderOutput"
>GreedySearchEncoderDecoderOutput</a>,</li>
<li><a
  href="/docs/transformers/v4.34.0/en/internal/generation_utils#transformers.generation.SampleEncoderDecoderOutput"
>SampleEncoderDecoderOutput</a>,</li>
<li><a
  href="/docs/transformers/v4.34.0/en/internal/generation_utils#transformers.generation.BeamSearchEncoderDecoderOutput"
>BeamSearchEncoderDecoderOutput</a>,</li>
<li><a
  href="/docs/transformers/v4.34.0/en/internal/generation_utils#transformers.generation.BeamSampleEncoderDecoderOutput"
>BeamSampleEncoderDecoderOutput</a></li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput"
>ModelOutput</a> or <code>torch.LongTensor</code></p>
`}}),Y=new jn({props:{warning:!0,$$slots:{default:[In]},$$scope:{ctx:Xe}}}),$e=new K({}),xe=new J({props:{name:"class transformers.Pop2PianoTokenizer",anchor:"transformers.Pop2PianoTokenizer",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L12"}}),Ge=new J({props:{name:"__call__",anchor:"transformers.Pop2PianoTokenizer.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),Ie=new K({}),ze=new J({props:{name:"class transformers.Pop2PianoProcessor",anchor:"transformers.Pop2PianoProcessor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L19"}}),Ze=new J({props:{name:"__call__",anchor:"transformers.Pop2PianoProcessor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),{c(){u=n("meta"),M=i(),v=n("p"),B=i(),k=n("h1"),W=n("a"),at=n("span"),m(ee.$$.fragment),io=i(),Be=n("span"),Be.textContent=Go,ft=i(),V=n("div"),V.innerHTML=Io,gt=i(),U=n("h2"),R=n("a"),st=n("span"),m(te.$$.fragment),lo=i(),We=n("span"),We.textContent=zo,_t=i(),oe=n("p"),oe.innerHTML=Zo,yt=i(),ne=n("p"),ne.textContent=Fo,vt=i(),ae=n("p"),ae.innerHTML=Xo,bt=i(),se=n("p"),se.textContent=Bo,wt=i(),re=n("p"),re.innerHTML=Wo,Mt=i(),ie=n("p"),ie.textContent=Vo,Tt=i(),le=n("ol"),le.innerHTML=Ro,Pt=i(),m(de.$$.fragment),jt=i(),ce=n("p"),ce.innerHTML=No,Jt=i(),pe=n("p"),pe.innerHTML=Eo,kt=i(),C=n("h2"),N=n("a"),rt=n("span"),m(ue.$$.fragment),co=i(),Ve=n("span"),Ve.textContent=Ho,Ut=i(),me=n("ul"),me.innerHTML=qo,Ct=i(),m(he.$$.fragment),$t=i(),fe=n("ul"),fe.innerHTML=Qo,xt=i(),m(ge.$$.fragment),Gt=i(),_e=n("ul"),_e.innerHTML=So,It=i(),m(ye.$$.fragment),zt=i(),ve=n("ul"),ve.innerHTML=Yo,Zt=i(),m(be.$$.fragment),Ft=i(),$=n("h2"),E=n("a"),it=n("span"),m(we.$$.fragment),po=i(),Re=n("span"),Re.textContent=Ao,Xt=i(),w=n("div"),m(Me.$$.fragment),uo=i(),Ne=n("p"),Ne.innerHTML=Lo,mo=i(),Ee=n("p"),Ee.innerHTML=Do,Bt=i(),x=n("h2"),H=n("a"),lt=n("span"),m(Te.$$.fragment),ho=i(),He=n("span"),He.textContent=Oo,Wt=i(),G=n("div"),m(Pe.$$.fragment),fo=i(),q=n("div"),m(je.$$.fragment),go=i(),qe=n("p"),qe.textContent=Ko,Vt=i(),I=n("h2"),Q=n("a"),dt=n("span"),m(Je.$$.fragment),_o=i(),Qe=n("span"),Qe.textContent=en,Rt=i(),b=n("div"),m(ke.$$.fragment),yo=i(),Se=n("p"),Se.innerHTML=tn,vo=i(),Ye=n("p"),Ye.innerHTML=on,bo=i(),T=n("div"),m(Ue.$$.fragment),wo=i(),Ae=n("p"),Ae.innerHTML=nn,Mo=i(),m(S.$$.fragment),To=i(),P=n("div"),m(Ce.$$.fragment),Po=i(),Le=n("p"),Le.textContent=an,jo=i(),m(Y.$$.fragment),Nt=i(),z=n("h2"),A=n("a"),ct=n("span"),m($e.$$.fragment),Jo=i(),De=n("span"),De.textContent=sn,Et=i(),Z=n("div"),m(xe.$$.fragment),ko=i(),L=n("div"),m(Ge.$$.fragment),Uo=i(),Oe=n("p"),Oe.textContent=rn,Ht=i(),F=n("h2"),D=n("a"),pt=n("span"),m(Ie.$$.fragment),Co=i(),Ke=n("span"),Ke.textContent=ln,qt=i(),X=n("div"),m(ze.$$.fragment),$o=i(),O=n("div"),m(Ze.$$.fragment),xo=i(),et=n("p"),et.textContent=dn,Qt=i(),ut=n("p"),this.h()},l(e){const o=xn("svelte-1phssyn",document.head);u=a(o,"META",{name:!0,content:!0}),o.forEach(t),M=l(e),v=a(e,"P",{}),c(v).forEach(t),B=l(e),k=a(e,"H1",{class:!0});var Fe=c(k);W=a(Fe,"A",{id:!0,class:!0,href:!0});var mt=c(W);at=a(mt,"SPAN",{});var cn=c(at);h(ee.$$.fragment,cn),cn.forEach(t),mt.forEach(t),io=l(Fe),Be=a(Fe,"SPAN",{"data-svelte-h":!0}),p(Be)!=="svelte-1g19b77"&&(Be.textContent=Go),Fe.forEach(t),ft=l(e),V=a(e,"DIV",{class:!0,"data-svelte-h":!0}),p(V)!=="svelte-pz3lm5"&&(V.innerHTML=Io),gt=l(e),U=a(e,"H2",{class:!0});var Yt=c(U);R=a(Yt,"A",{id:!0,class:!0,href:!0});var pn=c(R);st=a(pn,"SPAN",{});var un=c(st);h(te.$$.fragment,un),un.forEach(t),pn.forEach(t),lo=l(Yt),We=a(Yt,"SPAN",{"data-svelte-h":!0}),p(We)!=="svelte-1jsw1pg"&&(We.textContent=zo),Yt.forEach(t),_t=l(e),oe=a(e,"P",{"data-svelte-h":!0}),p(oe)!=="svelte-1hnpp4y"&&(oe.innerHTML=Zo),yt=l(e),ne=a(e,"P",{"data-svelte-h":!0}),p(ne)!=="svelte-ni45zt"&&(ne.textContent=Fo),vt=l(e),ae=a(e,"P",{"data-svelte-h":!0}),p(ae)!=="svelte-qqdyhn"&&(ae.innerHTML=Xo),bt=l(e),se=a(e,"P",{"data-svelte-h":!0}),p(se)!=="svelte-vfdo9a"&&(se.textContent=Bo),wt=l(e),re=a(e,"P",{"data-svelte-h":!0}),p(re)!=="svelte-nbagib"&&(re.innerHTML=Wo),Mt=l(e),ie=a(e,"P",{"data-svelte-h":!0}),p(ie)!=="svelte-axv494"&&(ie.textContent=Vo),Tt=l(e),le=a(e,"OL",{"data-svelte-h":!0}),p(le)!=="svelte-1raht03"&&(le.innerHTML=Ro),Pt=l(e),h(de.$$.fragment,e),jt=l(e),ce=a(e,"P",{"data-svelte-h":!0}),p(ce)!=="svelte-1co0fex"&&(ce.innerHTML=No),Jt=l(e),pe=a(e,"P",{"data-svelte-h":!0}),p(pe)!=="svelte-1g8fp7r"&&(pe.innerHTML=Eo),kt=l(e),C=a(e,"H2",{class:!0});var At=c(C);N=a(At,"A",{id:!0,class:!0,href:!0});var mn=c(N);rt=a(mn,"SPAN",{});var hn=c(rt);h(ue.$$.fragment,hn),hn.forEach(t),mn.forEach(t),co=l(At),Ve=a(At,"SPAN",{"data-svelte-h":!0}),p(Ve)!=="svelte-byb5hs"&&(Ve.textContent=Ho),At.forEach(t),Ut=l(e),me=a(e,"UL",{"data-svelte-h":!0}),p(me)!=="svelte-1kx0lud"&&(me.innerHTML=qo),Ct=l(e),h(he.$$.fragment,e),$t=l(e),fe=a(e,"UL",{"data-svelte-h":!0}),p(fe)!=="svelte-v9o7u6"&&(fe.innerHTML=Qo),xt=l(e),h(ge.$$.fragment,e),Gt=l(e),_e=a(e,"UL",{"data-svelte-h":!0}),p(_e)!=="svelte-q0f5tb"&&(_e.innerHTML=So),It=l(e),h(ye.$$.fragment,e),zt=l(e),ve=a(e,"UL",{"data-svelte-h":!0}),p(ve)!=="svelte-1awpm4y"&&(ve.innerHTML=Yo),Zt=l(e),h(be.$$.fragment,e),Ft=l(e),$=a(e,"H2",{class:!0});var Lt=c($);E=a(Lt,"A",{id:!0,class:!0,href:!0});var fn=c(E);it=a(fn,"SPAN",{});var gn=c(it);h(we.$$.fragment,gn),gn.forEach(t),fn.forEach(t),po=l(Lt),Re=a(Lt,"SPAN",{"data-svelte-h":!0}),p(Re)!=="svelte-13xxpxx"&&(Re.textContent=Ao),Lt.forEach(t),Xt=l(e),w=a(e,"DIV",{class:!0});var tt=c(w);h(Me.$$.fragment,tt),uo=l(tt),Ne=a(tt,"P",{"data-svelte-h":!0}),p(Ne)!=="svelte-1w6f5f2"&&(Ne.innerHTML=Lo),mo=l(tt),Ee=a(tt,"P",{"data-svelte-h":!0}),p(Ee)!=="svelte-10kqkkl"&&(Ee.innerHTML=Do),tt.forEach(t),Bt=l(e),x=a(e,"H2",{class:!0});var Dt=c(x);H=a(Dt,"A",{id:!0,class:!0,href:!0});var _n=c(H);lt=a(_n,"SPAN",{});var yn=c(lt);h(Te.$$.fragment,yn),yn.forEach(t),_n.forEach(t),ho=l(Dt),He=a(Dt,"SPAN",{"data-svelte-h":!0}),p(He)!=="svelte-1iej5z5"&&(He.textContent=Oo),Dt.forEach(t),Wt=l(e),G=a(e,"DIV",{class:!0});var Ot=c(G);h(Pe.$$.fragment,Ot),fo=l(Ot),q=a(Ot,"DIV",{class:!0});var Kt=c(q);h(je.$$.fragment,Kt),go=l(Kt),qe=a(Kt,"P",{"data-svelte-h":!0}),p(qe)!=="svelte-1eed40t"&&(qe.textContent=Ko),Kt.forEach(t),Ot.forEach(t),Vt=l(e),I=a(e,"H2",{class:!0});var eo=c(I);Q=a(eo,"A",{id:!0,class:!0,href:!0});var vn=c(Q);dt=a(vn,"SPAN",{});var bn=c(dt);h(Je.$$.fragment,bn),bn.forEach(t),vn.forEach(t),_o=l(eo),Qe=a(eo,"SPAN",{"data-svelte-h":!0}),p(Qe)!=="svelte-yxxvwo"&&(Qe.textContent=en),eo.forEach(t),Rt=l(e),b=a(e,"DIV",{class:!0});var j=c(b);h(ke.$$.fragment,j),yo=l(j),Se=a(j,"P",{"data-svelte-h":!0}),p(Se)!=="svelte-1h0mm0o"&&(Se.innerHTML=tn),vo=l(j),Ye=a(j,"P",{"data-svelte-h":!0}),p(Ye)!=="svelte-hswkmf"&&(Ye.innerHTML=on),bo=l(j),T=a(j,"DIV",{class:!0});var ot=c(T);h(Ue.$$.fragment,ot),wo=l(ot),Ae=a(ot,"P",{"data-svelte-h":!0}),p(Ae)!=="svelte-1t6e20p"&&(Ae.innerHTML=nn),Mo=l(ot),h(S.$$.fragment,ot),ot.forEach(t),To=l(j),P=a(j,"DIV",{class:!0});var nt=c(P);h(Ce.$$.fragment,nt),Po=l(nt),Le=a(nt,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-roqoi3"&&(Le.textContent=an),jo=l(nt),h(Y.$$.fragment,nt),nt.forEach(t),j.forEach(t),Nt=l(e),z=a(e,"H2",{class:!0});var to=c(z);A=a(to,"A",{id:!0,class:!0,href:!0});var wn=c(A);ct=a(wn,"SPAN",{});var Mn=c(ct);h($e.$$.fragment,Mn),Mn.forEach(t),wn.forEach(t),Jo=l(to),De=a(to,"SPAN",{"data-svelte-h":!0}),p(De)!=="svelte-1pfuc7m"&&(De.textContent=sn),to.forEach(t),Et=l(e),Z=a(e,"DIV",{class:!0});var oo=c(Z);h(xe.$$.fragment,oo),ko=l(oo),L=a(oo,"DIV",{class:!0});var no=c(L);h(Ge.$$.fragment,no),Uo=l(no),Oe=a(no,"P",{"data-svelte-h":!0}),p(Oe)!=="svelte-1eed40t"&&(Oe.textContent=rn),no.forEach(t),oo.forEach(t),Ht=l(e),F=a(e,"H2",{class:!0});var ao=c(F);D=a(ao,"A",{id:!0,class:!0,href:!0});var Tn=c(D);pt=a(Tn,"SPAN",{});var Pn=c(pt);h(Ie.$$.fragment,Pn),Pn.forEach(t),Tn.forEach(t),Co=l(ao),Ke=a(ao,"SPAN",{"data-svelte-h":!0}),p(Ke)!=="svelte-g9jzuh"&&(Ke.textContent=ln),ao.forEach(t),qt=l(e),X=a(e,"DIV",{class:!0});var so=c(X);h(ze.$$.fragment,so),$o=l(so),O=a(so,"DIV",{class:!0});var ro=c(O);h(Ze.$$.fragment,ro),xo=l(ro),et=a(ro,"P",{"data-svelte-h":!0}),p(et)!=="svelte-1eed40t"&&(et.textContent=dn),ro.forEach(t),so.forEach(t),Qt=l(e),ut=a(e,"P",{}),c(ut).forEach(t),this.h()},h(){d(u,"name","hf:doc:metadata"),d(u,"content",JSON.stringify(Zn)),d(W,"id","pop2piano"),d(W,"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(W,"href","#pop2piano"),d(k,"class","relative group"),d(V,"class","flex flex-wrap space-x-1"),d(R,"id","overview"),d(R,"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(R,"href","#overview"),d(U,"class","relative group"),d(N,"id","examples"),d(N,"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(N,"href","#examples"),d(C,"class","relative group"),d(E,"id","transformers.Pop2PianoConfig"),d(E,"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(E,"href","#transformers.Pop2PianoConfig"),d($,"class","relative group"),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(H,"id","transformers.Pop2PianoFeatureExtractor"),d(H,"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(H,"href","#transformers.Pop2PianoFeatureExtractor"),d(x,"class","relative group"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Q,"id","transformers.Pop2PianoForConditionalGeneration"),d(Q,"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(Q,"href","#transformers.Pop2PianoForConditionalGeneration"),d(I,"class","relative group"),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(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(A,"id","transformers.Pop2PianoTokenizer"),d(A,"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(A,"href","#transformers.Pop2PianoTokenizer"),d(z,"class","relative group"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(D,"id","transformers.Pop2PianoProcessor"),d(D,"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(D,"href","#transformers.Pop2PianoProcessor"),d(F,"class","relative group"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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")},m(e,o){r(document.head,u),s(e,M,o),s(e,v,o),s(e,B,o),s(e,k,o),r(k,W),r(W,at),f(ee,at,null),r(k,io),r(k,Be),s(e,ft,o),s(e,V,o),s(e,gt,o),s(e,U,o),r(U,R),r(R,st),f(te,st,null),r(U,lo),r(U,We),s(e,_t,o),s(e,oe,o),s(e,yt,o),s(e,ne,o),s(e,vt,o),s(e,ae,o),s(e,bt,o),s(e,se,o),s(e,wt,o),s(e,re,o),s(e,Mt,o),s(e,ie,o),s(e,Tt,o),s(e,le,o),s(e,Pt,o),f(de,e,o),s(e,jt,o),s(e,ce,o),s(e,Jt,o),s(e,pe,o),s(e,kt,o),s(e,C,o),r(C,N),r(N,rt),f(ue,rt,null),r(C,co),r(C,Ve),s(e,Ut,o),s(e,me,o),s(e,Ct,o),f(he,e,o),s(e,$t,o),s(e,fe,o),s(e,xt,o),f(ge,e,o),s(e,Gt,o),s(e,_e,o),s(e,It,o),f(ye,e,o),s(e,zt,o),s(e,ve,o),s(e,Zt,o),f(be,e,o),s(e,Ft,o),s(e,$,o),r($,E),r(E,it),f(we,it,null),r($,po),r($,Re),s(e,Xt,o),s(e,w,o),f(Me,w,null),r(w,uo),r(w,Ne),r(w,mo),r(w,Ee),s(e,Bt,o),s(e,x,o),r(x,H),r(H,lt),f(Te,lt,null),r(x,ho),r(x,He),s(e,Wt,o),s(e,G,o),f(Pe,G,null),r(G,fo),r(G,q),f(je,q,null),r(q,go),r(q,qe),s(e,Vt,o),s(e,I,o),r(I,Q),r(Q,dt),f(Je,dt,null),r(I,_o),r(I,Qe),s(e,Rt,o),s(e,b,o),f(ke,b,null),r(b,yo),r(b,Se),r(b,vo),r(b,Ye),r(b,bo),r(b,T),f(Ue,T,null),r(T,wo),r(T,Ae),r(T,Mo),f(S,T,null),r(b,To),r(b,P),f(Ce,P,null),r(P,Po),r(P,Le),r(P,jo),f(Y,P,null),s(e,Nt,o),s(e,z,o),r(z,A),r(A,ct),f($e,ct,null),r(z,Jo),r(z,De),s(e,Et,o),s(e,Z,o),f(xe,Z,null),r(Z,ko),r(Z,L),f(Ge,L,null),r(L,Uo),r(L,Oe),s(e,Ht,o),s(e,F,o),r(F,D),r(D,pt),f(Ie,pt,null),r(F,Co),r(F,Ke),s(e,qt,o),s(e,X,o),f(ze,X,null),r(X,$o),r(X,O),f(Ze,O,null),r(O,xo),r(O,et),s(e,Qt,o),s(e,ut,o),St=!0},p(e,[o]){const Fe={};o&2&&(Fe.$$scope={dirty:o,ctx:e}),S.$set(Fe);const mt={};o&2&&(mt.$$scope={dirty:o,ctx:e}),Y.$set(mt)},i(e){St||(g(ee.$$.fragment,e),g(te.$$.fragment,e),g(de.$$.fragment,e),g(ue.$$.fragment,e),g(he.$$.fragment,e),g(ge.$$.fragment,e),g(ye.$$.fragment,e),g(be.$$.fragment,e),g(we.$$.fragment,e),g(Me.$$.fragment,e),g(Te.$$.fragment,e),g(Pe.$$.fragment,e),g(je.$$.fragment,e),g(Je.$$.fragment,e),g(ke.$$.fragment,e),g(Ue.$$.fragment,e),g(S.$$.fragment,e),g(Ce.$$.fragment,e),g(Y.$$.fragment,e),g($e.$$.fragment,e),g(xe.$$.fragment,e),g(Ge.$$.fragment,e),g(Ie.$$.fragment,e),g(ze.$$.fragment,e),g(Ze.$$.fragment,e),St=!0)},o(e){_(ee.$$.fragment,e),_(te.$$.fragment,e),_(de.$$.fragment,e),_(ue.$$.fragment,e),_(he.$$.fragment,e),_(ge.$$.fragment,e),_(ye.$$.fragment,e),_(be.$$.fragment,e),_(we.$$.fragment,e),_(Me.$$.fragment,e),_(Te.$$.fragment,e),_(Pe.$$.fragment,e),_(je.$$.fragment,e),_(Je.$$.fragment,e),_(ke.$$.fragment,e),_(Ue.$$.fragment,e),_(S.$$.fragment,e),_(Ce.$$.fragment,e),_(Y.$$.fragment,e),_($e.$$.fragment,e),_(xe.$$.fragment,e),_(Ge.$$.fragment,e),_(Ie.$$.fragment,e),_(ze.$$.fragment,e),_(Ze.$$.fragment,e),St=!1},d(e){e&&(t(M),t(v),t(B),t(k),t(ft),t(V),t(gt),t(U),t(_t),t(oe),t(yt),t(ne),t(vt),t(ae),t(bt),t(se),t(wt),t(re),t(Mt),t(ie),t(Tt),t(le),t(Pt),t(jt),t(ce),t(Jt),t(pe),t(kt),t(C),t(Ut),t(me),t(Ct),t($t),t(fe),t(xt),t(Gt),t(_e),t(It),t(zt),t(ve),t(Zt),t(Ft),t($),t(Xt),t(w),t(Bt),t(x),t(Wt),t(G),t(Vt),t(I),t(Rt),t(b),t(Nt),t(z),t(Et),t(Z),t(Ht),t(F),t(qt),t(X),t(Qt),t(ut)),t(u),y(ee),y(te),y(de,e),y(ue),y(he,e),y(ge,e),y(ye,e),y(be,e),y(we),y(Me),y(Te),y(Pe),y(je),y(Je),y(ke),y(Ue),y(S),y(Ce),y(Y),y($e),y(xe),y(Ge),y(Ie),y(ze),y(Ze)}}}const Zn={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 Fn(Xe){return Un(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class En extends Cn{constructor(u){super(),$n(this,u,Fn,zn,kn,{})}}export{En as component};
