import{s as mo,o as uo,n as po}from"../chunks/scheduler.25b97de1.js";import{S as ho,i as fo,g as r,s as a,r as d,A as go,h as i,f as o,c as s,j as M,u as c,x as g,k as b,y as l,a as n,v as p,d as m,t as u,w as h}from"../chunks/index.d9030fc9.js";import{T as co}from"../chunks/Tip.baa67368.js";import{D as J}from"../chunks/Docstring.e257edda.js";import{C as Be}from"../chunks/CodeBlock.e6cd0d95.js";import{H as G,E as _o}from"../chunks/EditOnGithub.91d95064.js";function yo(Pe){let f,T=`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(){f=r("p"),f.innerHTML=T},l(_){f=i(_,"P",{"data-svelte-h":!0}),g(f)!=="svelte-fincs2"&&(f.innerHTML=T)},m(_,I){n(_,f,I)},p:po,d(_){_&&o(f)}}}function bo(Pe){let f,T=`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(){f=r("p"),f.innerHTML=T},l(_){f=i(_,"P",{"data-svelte-h":!0}),g(f)!=="svelte-mxjg2r"&&(f.innerHTML=T)},m(_,I){n(_,f,I)},p:po,d(_){_&&o(f)}}}function Mo(Pe){let f,T,_,I,W,Fe,z,Vt='<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>',We,V,Ve,R,Rt='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.',Re,q,qt=`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.`,qe,N,Nt=`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.`,Ne,H,Ht="The abstract from the paper is the following:",He,E,Et=`<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>`,Ee,Q,Qt=`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>.`,Qe,Y,Ye,S,Yt="<li>To use Pop2Piano, you will need to install the 🤗 Transformers library, as well as the following third party modules:</li>",Se,L,Le,D,St="Please note that you may need to restart your runtime after installation.",De,A,Lt="<li>Pop2Piano is an Encoder-Decoder based model like T5.</li> <li>Pop2Piano can be used to generate midi-audio files for a given audio sequence.</li> <li>Choosing different composers in <code>Pop2PianoForConditionalGeneration.generate()</code> can lead to variety of different results.</li> <li>Setting the sampling rate to 44.1 kHz when loading the audio file can give good performance.</li> <li>Though Pop2Piano was mainly trained on Korean Pop music, it also does pretty well on other Western Pop or Hip Hop songs.</li>",Ae,O,Oe,K,Dt="<li>Example using HuggingFace Dataset:</li>",Ke,ee,et,te,At="<li>Example using your own audio file:</li>",tt,oe,ot,ne,Ot="<li>Example of processing multiple audio files in batch:</li>",nt,ae,at,se,Kt="<li>Example of processing multiple audio files in batch (Using <code>Pop2PianoFeatureExtractor</code> and <code>Pop2PianoTokenizer</code>):</li>",st,re,rt,ie,it,w,le,Pt,je,eo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30788/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.`,jt,Je,to=`Configuration objects inherit from <a href="/docs/transformers/pr_30788/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/pr_30788/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,lt,de,dt,k,ce,Jt,Z,pe,kt,ke,oo="Call self as a function.",ct,me,pt,y,ue,Ut,Ue,no=`Pop2Piano Model with a <code>language modeling</code> head on top.
This model inherits from <a href="/docs/transformers/pr_30788/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.)`,$t,$e,ao=`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.`,Ct,v,he,Gt,Ce,so='The <a href="/docs/transformers/pr_30788/en/model_doc/pop2piano#transformers.Pop2PianoForConditionalGeneration">Pop2PianoForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',It,x,zt,P,fe,Zt,Ge,ro="Generates token ids for midi outputs.",xt,X,mt,ge,ut,U,_e,Xt,B,ye,Bt,Ie,io="Call self as a function.",ht,be,ft,$,Me,Ft,F,we,Wt,ze,lo="Call self as a function.",gt,Te,_t,Xe,yt;return W=new G({props:{title:"Pop2Piano",local:"pop2piano",headingTag:"h1"}}),V=new G({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Y=new G({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),L=new Be({props:{code:"cGlwJTIwaW5zdGFsbCUyMHByZXR0eS1taWRpJTNEJTNEMC4yLjklMjBlc3NlbnRpYSUzRCUzRDIuMWI2LmRldjEwMzQlMjBsaWJyb3NhJTIwc2NpcHk=",highlighted:"pip install pretty-midi==0.2.9 essentia==2.1b6.dev1034 librosa scipy",wrap:!1}}),O=new G({props:{title:"Examples",local:"examples",headingTag:"h2"}}),ee=new Be({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}}),oe=new Be({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}}),ae=new Be({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}}),re=new Be({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}}),ie=new G({props:{title:"Pop2PianoConfig",local:"transformers.Pop2PianoConfig",headingTag:"h2"}}),le=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/pr_30788/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/vr_30788/src/transformers/models/pop2piano/configuration_pop2piano.py#L24"}}),de=new G({props:{title:"Pop2PianoFeatureExtractor",local:"transformers.Pop2PianoFeatureExtractor",headingTag:"h2"}}),ce=new J({props:{name:"class transformers.Pop2PianoFeatureExtractor",anchor:"transformers.Pop2PianoFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30788/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L5"}}),pe=new J({props:{name:"__call__",anchor:"transformers.Pop2PianoFeatureExtractor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),me=new G({props:{title:"Pop2PianoForConditionalGeneration",local:"transformers.Pop2PianoForConditionalGeneration",headingTag:"h2"}}),ue=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/pr_30788/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/pr_30788/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/vr_30788/src/transformers/models/pop2piano/modeling_pop2piano.py#L1003"}}),he=new J({props:{name:"forward",anchor:"transformers.Pop2PianoForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"decoder_input_ids",val:": Optional = None"},{name:"decoder_attention_mask",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"decoder_head_mask",val:": Optional = None"},{name:"cross_attn_head_mask",val:": Optional = None"},{name:"encoder_outputs",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"input_features",val:": Optional = None"},{name:"decoder_inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30788/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30788/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/pr_30788/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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">Pop2Piano 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/pr_30788/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30788/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/pr_30788/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/pr_30788/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/vr_30788/src/transformers/models/pop2piano/modeling_pop2piano.py#L1103",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30788/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/pr_30788/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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30788/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),x=new co({props:{$$slots:{default:[yo]},$$scope:{ctx:Pe}}}),fe=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/pr_30788/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/vr_30788/src/transformers/models/pop2piano/modeling_pop2piano.py#L1211",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30788/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/pr_30788/en/main_classes/output#transformers.utils.ModelOutput"
>ModelOutput</a> types are:</p>
<ul>
<li><a
  href="/docs/transformers/pr_30788/en/internal/generation_utils#transformers.generation.GenerateEncoderDecoderOutput"
>GenerateEncoderDecoderOutput</a>,</li>
<li><a
  href="/docs/transformers/pr_30788/en/internal/generation_utils#transformers.generation.GenerateBeamEncoderDecoderOutput"
>GenerateBeamEncoderDecoderOutput</a></li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30788/en/main_classes/output#transformers.utils.ModelOutput"
>ModelOutput</a> or <code>torch.LongTensor</code></p>
`}}),X=new co({props:{warning:!0,$$slots:{default:[bo]},$$scope:{ctx:Pe}}}),ge=new G({props:{title:"Pop2PianoTokenizer",local:"transformers.Pop2PianoTokenizer",headingTag:"h2"}}),_e=new J({props:{name:"class transformers.Pop2PianoTokenizer",anchor:"transformers.Pop2PianoTokenizer",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30788/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L12"}}),ye=new J({props:{name:"__call__",anchor:"transformers.Pop2PianoTokenizer.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),be=new G({props:{title:"Pop2PianoProcessor",local:"transformers.Pop2PianoProcessor",headingTag:"h2"}}),Me=new J({props:{name:"class transformers.Pop2PianoProcessor",anchor:"transformers.Pop2PianoProcessor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30788/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L19"}}),we=new J({props:{name:"__call__",anchor:"transformers.Pop2PianoProcessor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),Te=new _o({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/pop2piano.md"}}),{c(){f=r("meta"),T=a(),_=r("p"),I=a(),d(W.$$.fragment),Fe=a(),z=r("div"),z.innerHTML=Vt,We=a(),d(V.$$.fragment),Ve=a(),R=r("p"),R.innerHTML=Rt,Re=a(),q=r("p"),q.textContent=qt,qe=a(),N=r("p"),N.innerHTML=Nt,Ne=a(),H=r("p"),H.textContent=Ht,He=a(),E=r("p"),E.innerHTML=Et,Ee=a(),Q=r("p"),Q.innerHTML=Qt,Qe=a(),d(Y.$$.fragment),Ye=a(),S=r("ul"),S.innerHTML=Yt,Se=a(),d(L.$$.fragment),Le=a(),D=r("p"),D.textContent=St,De=a(),A=r("ul"),A.innerHTML=Lt,Ae=a(),d(O.$$.fragment),Oe=a(),K=r("ul"),K.innerHTML=Dt,Ke=a(),d(ee.$$.fragment),et=a(),te=r("ul"),te.innerHTML=At,tt=a(),d(oe.$$.fragment),ot=a(),ne=r("ul"),ne.innerHTML=Ot,nt=a(),d(ae.$$.fragment),at=a(),se=r("ul"),se.innerHTML=Kt,st=a(),d(re.$$.fragment),rt=a(),d(ie.$$.fragment),it=a(),w=r("div"),d(le.$$.fragment),Pt=a(),je=r("p"),je.innerHTML=eo,jt=a(),Je=r("p"),Je.innerHTML=to,lt=a(),d(de.$$.fragment),dt=a(),k=r("div"),d(ce.$$.fragment),Jt=a(),Z=r("div"),d(pe.$$.fragment),kt=a(),ke=r("p"),ke.textContent=oo,ct=a(),d(me.$$.fragment),pt=a(),y=r("div"),d(ue.$$.fragment),Ut=a(),Ue=r("p"),Ue.innerHTML=no,$t=a(),$e=r("p"),$e.innerHTML=ao,Ct=a(),v=r("div"),d(he.$$.fragment),Gt=a(),Ce=r("p"),Ce.innerHTML=so,It=a(),d(x.$$.fragment),zt=a(),P=r("div"),d(fe.$$.fragment),Zt=a(),Ge=r("p"),Ge.textContent=ro,xt=a(),d(X.$$.fragment),mt=a(),d(ge.$$.fragment),ut=a(),U=r("div"),d(_e.$$.fragment),Xt=a(),B=r("div"),d(ye.$$.fragment),Bt=a(),Ie=r("p"),Ie.textContent=io,ht=a(),d(be.$$.fragment),ft=a(),$=r("div"),d(Me.$$.fragment),Ft=a(),F=r("div"),d(we.$$.fragment),Wt=a(),ze=r("p"),ze.textContent=lo,gt=a(),d(Te.$$.fragment),_t=a(),Xe=r("p"),this.h()},l(e){const t=go("svelte-u9bgzb",document.head);f=i(t,"META",{name:!0,content:!0}),t.forEach(o),T=s(e),_=i(e,"P",{}),M(_).forEach(o),I=s(e),c(W.$$.fragment,e),Fe=s(e),z=i(e,"DIV",{class:!0,"data-svelte-h":!0}),g(z)!=="svelte-pz3lm5"&&(z.innerHTML=Vt),We=s(e),c(V.$$.fragment,e),Ve=s(e),R=i(e,"P",{"data-svelte-h":!0}),g(R)!=="svelte-1hnpp4y"&&(R.innerHTML=Rt),Re=s(e),q=i(e,"P",{"data-svelte-h":!0}),g(q)!=="svelte-ni45zt"&&(q.textContent=qt),qe=s(e),N=i(e,"P",{"data-svelte-h":!0}),g(N)!=="svelte-qqdyhn"&&(N.innerHTML=Nt),Ne=s(e),H=i(e,"P",{"data-svelte-h":!0}),g(H)!=="svelte-vfdo9a"&&(H.textContent=Ht),He=s(e),E=i(e,"P",{"data-svelte-h":!0}),g(E)!=="svelte-nbagib"&&(E.innerHTML=Et),Ee=s(e),Q=i(e,"P",{"data-svelte-h":!0}),g(Q)!=="svelte-1g8fp7r"&&(Q.innerHTML=Qt),Qe=s(e),c(Y.$$.fragment,e),Ye=s(e),S=i(e,"UL",{"data-svelte-h":!0}),g(S)!=="svelte-d30h4n"&&(S.innerHTML=Yt),Se=s(e),c(L.$$.fragment,e),Le=s(e),D=i(e,"P",{"data-svelte-h":!0}),g(D)!=="svelte-o4f2iu"&&(D.textContent=St),De=s(e),A=i(e,"UL",{"data-svelte-h":!0}),g(A)!=="svelte-1kascwk"&&(A.innerHTML=Lt),Ae=s(e),c(O.$$.fragment,e),Oe=s(e),K=i(e,"UL",{"data-svelte-h":!0}),g(K)!=="svelte-1kx0lud"&&(K.innerHTML=Dt),Ke=s(e),c(ee.$$.fragment,e),et=s(e),te=i(e,"UL",{"data-svelte-h":!0}),g(te)!=="svelte-v9o7u6"&&(te.innerHTML=At),tt=s(e),c(oe.$$.fragment,e),ot=s(e),ne=i(e,"UL",{"data-svelte-h":!0}),g(ne)!=="svelte-q0f5tb"&&(ne.innerHTML=Ot),nt=s(e),c(ae.$$.fragment,e),at=s(e),se=i(e,"UL",{"data-svelte-h":!0}),g(se)!=="svelte-1awpm4y"&&(se.innerHTML=Kt),st=s(e),c(re.$$.fragment,e),rt=s(e),c(ie.$$.fragment,e),it=s(e),w=i(e,"DIV",{class:!0});var C=M(w);c(le.$$.fragment,C),Pt=s(C),je=i(C,"P",{"data-svelte-h":!0}),g(je)!=="svelte-19jgukg"&&(je.innerHTML=eo),jt=s(C),Je=i(C,"P",{"data-svelte-h":!0}),g(Je)!=="svelte-1obt5hj"&&(Je.innerHTML=to),C.forEach(o),lt=s(e),c(de.$$.fragment,e),dt=s(e),k=i(e,"DIV",{class:!0});var ve=M(k);c(ce.$$.fragment,ve),Jt=s(ve),Z=i(ve,"DIV",{class:!0});var bt=M(Z);c(pe.$$.fragment,bt),kt=s(bt),ke=i(bt,"P",{"data-svelte-h":!0}),g(ke)!=="svelte-1eed40t"&&(ke.textContent=oo),bt.forEach(o),ve.forEach(o),ct=s(e),c(me.$$.fragment,e),pt=s(e),y=i(e,"DIV",{class:!0});var j=M(y);c(ue.$$.fragment,j),Ut=s(j),Ue=i(j,"P",{"data-svelte-h":!0}),g(Ue)!=="svelte-1gsskh0"&&(Ue.innerHTML=no),$t=s(j),$e=i(j,"P",{"data-svelte-h":!0}),g($e)!=="svelte-hswkmf"&&($e.innerHTML=ao),Ct=s(j),v=i(j,"DIV",{class:!0});var Ze=M(v);c(he.$$.fragment,Ze),Gt=s(Ze),Ce=i(Ze,"P",{"data-svelte-h":!0}),g(Ce)!=="svelte-xr6o4v"&&(Ce.innerHTML=so),It=s(Ze),c(x.$$.fragment,Ze),Ze.forEach(o),zt=s(j),P=i(j,"DIV",{class:!0});var xe=M(P);c(fe.$$.fragment,xe),Zt=s(xe),Ge=i(xe,"P",{"data-svelte-h":!0}),g(Ge)!=="svelte-roqoi3"&&(Ge.textContent=ro),xt=s(xe),c(X.$$.fragment,xe),xe.forEach(o),j.forEach(o),mt=s(e),c(ge.$$.fragment,e),ut=s(e),U=i(e,"DIV",{class:!0});var Mt=M(U);c(_e.$$.fragment,Mt),Xt=s(Mt),B=i(Mt,"DIV",{class:!0});var wt=M(B);c(ye.$$.fragment,wt),Bt=s(wt),Ie=i(wt,"P",{"data-svelte-h":!0}),g(Ie)!=="svelte-1eed40t"&&(Ie.textContent=io),wt.forEach(o),Mt.forEach(o),ht=s(e),c(be.$$.fragment,e),ft=s(e),$=i(e,"DIV",{class:!0});var Tt=M($);c(Me.$$.fragment,Tt),Ft=s(Tt),F=i(Tt,"DIV",{class:!0});var vt=M(F);c(we.$$.fragment,vt),Wt=s(vt),ze=i(vt,"P",{"data-svelte-h":!0}),g(ze)!=="svelte-1eed40t"&&(ze.textContent=lo),vt.forEach(o),Tt.forEach(o),gt=s(e),c(Te.$$.fragment,e),_t=s(e),Xe=i(e,"P",{}),M(Xe).forEach(o),this.h()},h(){b(f,"name","hf:doc:metadata"),b(f,"content",wo),b(z,"class","flex flex-wrap space-x-1"),b(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b($,"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,t){l(document.head,f),n(e,T,t),n(e,_,t),n(e,I,t),p(W,e,t),n(e,Fe,t),n(e,z,t),n(e,We,t),p(V,e,t),n(e,Ve,t),n(e,R,t),n(e,Re,t),n(e,q,t),n(e,qe,t),n(e,N,t),n(e,Ne,t),n(e,H,t),n(e,He,t),n(e,E,t),n(e,Ee,t),n(e,Q,t),n(e,Qe,t),p(Y,e,t),n(e,Ye,t),n(e,S,t),n(e,Se,t),p(L,e,t),n(e,Le,t),n(e,D,t),n(e,De,t),n(e,A,t),n(e,Ae,t),p(O,e,t),n(e,Oe,t),n(e,K,t),n(e,Ke,t),p(ee,e,t),n(e,et,t),n(e,te,t),n(e,tt,t),p(oe,e,t),n(e,ot,t),n(e,ne,t),n(e,nt,t),p(ae,e,t),n(e,at,t),n(e,se,t),n(e,st,t),p(re,e,t),n(e,rt,t),p(ie,e,t),n(e,it,t),n(e,w,t),p(le,w,null),l(w,Pt),l(w,je),l(w,jt),l(w,Je),n(e,lt,t),p(de,e,t),n(e,dt,t),n(e,k,t),p(ce,k,null),l(k,Jt),l(k,Z),p(pe,Z,null),l(Z,kt),l(Z,ke),n(e,ct,t),p(me,e,t),n(e,pt,t),n(e,y,t),p(ue,y,null),l(y,Ut),l(y,Ue),l(y,$t),l(y,$e),l(y,Ct),l(y,v),p(he,v,null),l(v,Gt),l(v,Ce),l(v,It),p(x,v,null),l(y,zt),l(y,P),p(fe,P,null),l(P,Zt),l(P,Ge),l(P,xt),p(X,P,null),n(e,mt,t),p(ge,e,t),n(e,ut,t),n(e,U,t),p(_e,U,null),l(U,Xt),l(U,B),p(ye,B,null),l(B,Bt),l(B,Ie),n(e,ht,t),p(be,e,t),n(e,ft,t),n(e,$,t),p(Me,$,null),l($,Ft),l($,F),p(we,F,null),l(F,Wt),l(F,ze),n(e,gt,t),p(Te,e,t),n(e,_t,t),n(e,Xe,t),yt=!0},p(e,[t]){const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),x.$set(C);const ve={};t&2&&(ve.$$scope={dirty:t,ctx:e}),X.$set(ve)},i(e){yt||(m(W.$$.fragment,e),m(V.$$.fragment,e),m(Y.$$.fragment,e),m(L.$$.fragment,e),m(O.$$.fragment,e),m(ee.$$.fragment,e),m(oe.$$.fragment,e),m(ae.$$.fragment,e),m(re.$$.fragment,e),m(ie.$$.fragment,e),m(le.$$.fragment,e),m(de.$$.fragment,e),m(ce.$$.fragment,e),m(pe.$$.fragment,e),m(me.$$.fragment,e),m(ue.$$.fragment,e),m(he.$$.fragment,e),m(x.$$.fragment,e),m(fe.$$.fragment,e),m(X.$$.fragment,e),m(ge.$$.fragment,e),m(_e.$$.fragment,e),m(ye.$$.fragment,e),m(be.$$.fragment,e),m(Me.$$.fragment,e),m(we.$$.fragment,e),m(Te.$$.fragment,e),yt=!0)},o(e){u(W.$$.fragment,e),u(V.$$.fragment,e),u(Y.$$.fragment,e),u(L.$$.fragment,e),u(O.$$.fragment,e),u(ee.$$.fragment,e),u(oe.$$.fragment,e),u(ae.$$.fragment,e),u(re.$$.fragment,e),u(ie.$$.fragment,e),u(le.$$.fragment,e),u(de.$$.fragment,e),u(ce.$$.fragment,e),u(pe.$$.fragment,e),u(me.$$.fragment,e),u(ue.$$.fragment,e),u(he.$$.fragment,e),u(x.$$.fragment,e),u(fe.$$.fragment,e),u(X.$$.fragment,e),u(ge.$$.fragment,e),u(_e.$$.fragment,e),u(ye.$$.fragment,e),u(be.$$.fragment,e),u(Me.$$.fragment,e),u(we.$$.fragment,e),u(Te.$$.fragment,e),yt=!1},d(e){e&&(o(T),o(_),o(I),o(Fe),o(z),o(We),o(Ve),o(R),o(Re),o(q),o(qe),o(N),o(Ne),o(H),o(He),o(E),o(Ee),o(Q),o(Qe),o(Ye),o(S),o(Se),o(Le),o(D),o(De),o(A),o(Ae),o(Oe),o(K),o(Ke),o(et),o(te),o(tt),o(ot),o(ne),o(nt),o(at),o(se),o(st),o(rt),o(it),o(w),o(lt),o(dt),o(k),o(ct),o(pt),o(y),o(mt),o(ut),o(U),o(ht),o(ft),o($),o(gt),o(_t),o(Xe)),o(f),h(W,e),h(V,e),h(Y,e),h(L,e),h(O,e),h(ee,e),h(oe,e),h(ae,e),h(re,e),h(ie,e),h(le),h(de,e),h(ce),h(pe),h(me,e),h(ue),h(he),h(x),h(fe),h(X),h(ge,e),h(_e),h(ye),h(be,e),h(Me),h(we),h(Te,e)}}}const wo='{"title":"Pop2Piano","local":"pop2piano","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Examples","local":"examples","sections":[],"depth":2},{"title":"Pop2PianoConfig","local":"transformers.Pop2PianoConfig","sections":[],"depth":2},{"title":"Pop2PianoFeatureExtractor","local":"transformers.Pop2PianoFeatureExtractor","sections":[],"depth":2},{"title":"Pop2PianoForConditionalGeneration","local":"transformers.Pop2PianoForConditionalGeneration","sections":[],"depth":2},{"title":"Pop2PianoTokenizer","local":"transformers.Pop2PianoTokenizer","sections":[],"depth":2},{"title":"Pop2PianoProcessor","local":"transformers.Pop2PianoProcessor","sections":[],"depth":2}],"depth":1}';function To(Pe){return uo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $o extends ho{constructor(f){super(),fo(this,f,To,Mo,mo,{})}}export{$o as component};
