import{s as co,o as po,n as lo}from"../chunks/scheduler.9bc65507.js";import{S as mo,i as uo,g as r,s as a,r as d,A as ho,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.707bf1b6.js";import{T as io}from"../chunks/Tip.c2ecdbf4.js";import{D as J}from"../chunks/Docstring.17db21ae.js";import{C as Xe}from"../chunks/CodeBlock.54a9f38d.js";import{H as G}from"../chunks/Heading.342b1fa6.js";function fo(Te){let f,w=`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=w},l(_){f=i(_,"P",{"data-svelte-h":!0}),g(f)!=="svelte-fincs2"&&(f.innerHTML=w)},m(_,I){n(_,f,I)},p:lo,d(_){_&&o(f)}}}function go(Te){let f,w=`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=w},l(_){f=i(_,"P",{"data-svelte-h":!0}),g(f)!=="svelte-mxjg2r"&&(f.innerHTML=w)},m(_,I){n(_,f,I)},p:lo,d(_){_&&o(f)}}}function _o(Te){let f,w,_,I,W,Be,z,Ft='<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>',Fe,V,We,R,Wt='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.',Ve,q,Vt=`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.`,Re,N,Rt=`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.`,qe,H,qt="The abstract from the paper is the following:",Ne,E,Nt=`<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>`,He,Q,Ht=`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>.`,Ee,Y,Qe,S,Et="<li>To use Pop2Piano, you will need to install the 🤗 Transformers library, as well as the following third party modules:</li>",Ye,L,Se,D,Qt="Please note that you may need to restart your runtime after installation.",Le,A,Yt="<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>",De,O,Ae,K,St="<li>Example using HuggingFace Dataset:</li>",Oe,ee,Ke,te,Lt="<li>Example using your own audio file:</li>",et,oe,tt,ne,Dt="<li>Example of processing multiple audio files in batch:</li>",ot,ae,nt,se,At="<li>Example of processing multiple audio files in batch (Using <code>Pop2PianoFeatureExtractor</code> and <code>Pop2PianoTokenizer</code>):</li>",at,re,st,ie,rt,v,le,wt,Pe,Ot=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.37.1/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.`,Tt,je,Kt=`Configuration objects inherit from <a href="/docs/transformers/v4.37.1/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.37.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,it,de,lt,k,ce,Pt,Z,pe,jt,Je,eo="Call self as a function.",dt,me,ct,y,ue,Jt,ke,to=`Pop2Piano Model with a <code>language modeling</code> head on top.
This model inherits from <a href="/docs/transformers/v4.37.1/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.)`,kt,Ue,oo=`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.`,Ut,T,he,Ct,Ce,no='The <a href="/docs/transformers/v4.37.1/en/model_doc/pop2piano#transformers.Pop2PianoForConditionalGeneration">Pop2PianoForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',$t,x,Gt,P,fe,It,$e,ao="Generates token ids for midi outputs.",zt,X,pt,ge,mt,U,_e,Zt,B,ye,xt,Ge,so="Call self as a function.",ut,be,ht,C,Me,Xt,F,ve,Bt,Ie,ro="Call self as a function.",ft,xe,gt;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 Xe({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}}),O=new G({props:{title:"Examples",local:"examples",headingTag:"h2"}}),ee=new Xe({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 Xe({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 Xe({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 Xe({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/v4.37.1/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.37.1/src/transformers/models/pop2piano/configuration_pop2piano.py#L29"}}),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/v4.37.1/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/v4.37.1/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.37.1/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.37.1/src/transformers/models/pop2piano/modeling_pop2piano.py#L1009"}}),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/v4.37.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.37.1/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">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.37.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.37.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.37.1/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/v4.37.1/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.37.1/src/transformers/models/pop2piano/modeling_pop2piano.py#L1109",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p>A <a
  href="/docs/transformers/v4.37.1/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.37.1/en/main_classes/output#transformers.utils.ModelOutput"
>ModelOutput</a> types are:</p>
<ul>
<li><a
  href="/docs/transformers/v4.37.1/en/internal/generation_utils#transformers.generation.GenerateEncoderDecoderOutput"
>GenerateEncoderDecoderOutput</a>,</li>
<li><a
  href="/docs/transformers/v4.37.1/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/v4.37.1/en/main_classes/output#transformers.utils.ModelOutput"
>ModelOutput</a> or <code>torch.LongTensor</code></p>
`}}),X=new io({props:{warning:!0,$$slots:{default:[go]},$$scope:{ctx:Te}}}),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/v4.37.1/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/v4.37.1/src/transformers/utils/dummy_essentia_and_librosa_and_pretty_midi_and_scipy_and_torch_objects.py#L19"}}),ve=new J({props:{name:"__call__",anchor:"transformers.Pop2PianoProcessor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),{c(){f=r("meta"),w=a(),_=r("p"),I=a(),d(W.$$.fragment),Be=a(),z=r("div"),z.innerHTML=Ft,Fe=a(),d(V.$$.fragment),We=a(),R=r("p"),R.innerHTML=Wt,Ve=a(),q=r("p"),q.textContent=Vt,Re=a(),N=r("p"),N.innerHTML=Rt,qe=a(),H=r("p"),H.textContent=qt,Ne=a(),E=r("p"),E.innerHTML=Nt,He=a(),Q=r("p"),Q.innerHTML=Ht,Ee=a(),d(Y.$$.fragment),Qe=a(),S=r("ul"),S.innerHTML=Et,Ye=a(),d(L.$$.fragment),Se=a(),D=r("p"),D.textContent=Qt,Le=a(),A=r("ul"),A.innerHTML=Yt,De=a(),d(O.$$.fragment),Ae=a(),K=r("ul"),K.innerHTML=St,Oe=a(),d(ee.$$.fragment),Ke=a(),te=r("ul"),te.innerHTML=Lt,et=a(),d(oe.$$.fragment),tt=a(),ne=r("ul"),ne.innerHTML=Dt,ot=a(),d(ae.$$.fragment),nt=a(),se=r("ul"),se.innerHTML=At,at=a(),d(re.$$.fragment),st=a(),d(ie.$$.fragment),rt=a(),v=r("div"),d(le.$$.fragment),wt=a(),Pe=r("p"),Pe.innerHTML=Ot,Tt=a(),je=r("p"),je.innerHTML=Kt,it=a(),d(de.$$.fragment),lt=a(),k=r("div"),d(ce.$$.fragment),Pt=a(),Z=r("div"),d(pe.$$.fragment),jt=a(),Je=r("p"),Je.textContent=eo,dt=a(),d(me.$$.fragment),ct=a(),y=r("div"),d(ue.$$.fragment),Jt=a(),ke=r("p"),ke.innerHTML=to,kt=a(),Ue=r("p"),Ue.innerHTML=oo,Ut=a(),T=r("div"),d(he.$$.fragment),Ct=a(),Ce=r("p"),Ce.innerHTML=no,$t=a(),d(x.$$.fragment),Gt=a(),P=r("div"),d(fe.$$.fragment),It=a(),$e=r("p"),$e.textContent=ao,zt=a(),d(X.$$.fragment),pt=a(),d(ge.$$.fragment),mt=a(),U=r("div"),d(_e.$$.fragment),Zt=a(),B=r("div"),d(ye.$$.fragment),xt=a(),Ge=r("p"),Ge.textContent=so,ut=a(),d(be.$$.fragment),ht=a(),C=r("div"),d(Me.$$.fragment),Xt=a(),F=r("div"),d(ve.$$.fragment),Bt=a(),Ie=r("p"),Ie.textContent=ro,ft=a(),xe=r("p"),this.h()},l(e){const t=ho("svelte-u9bgzb",document.head);f=i(t,"META",{name:!0,content:!0}),t.forEach(o),w=s(e),_=i(e,"P",{}),M(_).forEach(o),I=s(e),c(W.$$.fragment,e),Be=s(e),z=i(e,"DIV",{class:!0,"data-svelte-h":!0}),g(z)!=="svelte-pz3lm5"&&(z.innerHTML=Ft),Fe=s(e),c(V.$$.fragment,e),We=s(e),R=i(e,"P",{"data-svelte-h":!0}),g(R)!=="svelte-1hnpp4y"&&(R.innerHTML=Wt),Ve=s(e),q=i(e,"P",{"data-svelte-h":!0}),g(q)!=="svelte-ni45zt"&&(q.textContent=Vt),Re=s(e),N=i(e,"P",{"data-svelte-h":!0}),g(N)!=="svelte-qqdyhn"&&(N.innerHTML=Rt),qe=s(e),H=i(e,"P",{"data-svelte-h":!0}),g(H)!=="svelte-vfdo9a"&&(H.textContent=qt),Ne=s(e),E=i(e,"P",{"data-svelte-h":!0}),g(E)!=="svelte-nbagib"&&(E.innerHTML=Nt),He=s(e),Q=i(e,"P",{"data-svelte-h":!0}),g(Q)!=="svelte-1g8fp7r"&&(Q.innerHTML=Ht),Ee=s(e),c(Y.$$.fragment,e),Qe=s(e),S=i(e,"UL",{"data-svelte-h":!0}),g(S)!=="svelte-d30h4n"&&(S.innerHTML=Et),Ye=s(e),c(L.$$.fragment,e),Se=s(e),D=i(e,"P",{"data-svelte-h":!0}),g(D)!=="svelte-o4f2iu"&&(D.textContent=Qt),Le=s(e),A=i(e,"UL",{"data-svelte-h":!0}),g(A)!=="svelte-1kascwk"&&(A.innerHTML=Yt),De=s(e),c(O.$$.fragment,e),Ae=s(e),K=i(e,"UL",{"data-svelte-h":!0}),g(K)!=="svelte-1kx0lud"&&(K.innerHTML=St),Oe=s(e),c(ee.$$.fragment,e),Ke=s(e),te=i(e,"UL",{"data-svelte-h":!0}),g(te)!=="svelte-v9o7u6"&&(te.innerHTML=Lt),et=s(e),c(oe.$$.fragment,e),tt=s(e),ne=i(e,"UL",{"data-svelte-h":!0}),g(ne)!=="svelte-q0f5tb"&&(ne.innerHTML=Dt),ot=s(e),c(ae.$$.fragment,e),nt=s(e),se=i(e,"UL",{"data-svelte-h":!0}),g(se)!=="svelte-1awpm4y"&&(se.innerHTML=At),at=s(e),c(re.$$.fragment,e),st=s(e),c(ie.$$.fragment,e),rt=s(e),v=i(e,"DIV",{class:!0});var $=M(v);c(le.$$.fragment,$),wt=s($),Pe=i($,"P",{"data-svelte-h":!0}),g(Pe)!=="svelte-k27jc8"&&(Pe.innerHTML=Ot),Tt=s($),je=i($,"P",{"data-svelte-h":!0}),g(je)!=="svelte-1chy751"&&(je.innerHTML=Kt),$.forEach(o),it=s(e),c(de.$$.fragment,e),lt=s(e),k=i(e,"DIV",{class:!0});var we=M(k);c(ce.$$.fragment,we),Pt=s(we),Z=i(we,"DIV",{class:!0});var _t=M(Z);c(pe.$$.fragment,_t),jt=s(_t),Je=i(_t,"P",{"data-svelte-h":!0}),g(Je)!=="svelte-1eed40t"&&(Je.textContent=eo),_t.forEach(o),we.forEach(o),dt=s(e),c(me.$$.fragment,e),ct=s(e),y=i(e,"DIV",{class:!0});var j=M(y);c(ue.$$.fragment,j),Jt=s(j),ke=i(j,"P",{"data-svelte-h":!0}),g(ke)!=="svelte-1vtnwmm"&&(ke.innerHTML=to),kt=s(j),Ue=i(j,"P",{"data-svelte-h":!0}),g(Ue)!=="svelte-hswkmf"&&(Ue.innerHTML=oo),Ut=s(j),T=i(j,"DIV",{class:!0});var ze=M(T);c(he.$$.fragment,ze),Ct=s(ze),Ce=i(ze,"P",{"data-svelte-h":!0}),g(Ce)!=="svelte-wp6jd3"&&(Ce.innerHTML=no),$t=s(ze),c(x.$$.fragment,ze),ze.forEach(o),Gt=s(j),P=i(j,"DIV",{class:!0});var Ze=M(P);c(fe.$$.fragment,Ze),It=s(Ze),$e=i(Ze,"P",{"data-svelte-h":!0}),g($e)!=="svelte-roqoi3"&&($e.textContent=ao),zt=s(Ze),c(X.$$.fragment,Ze),Ze.forEach(o),j.forEach(o),pt=s(e),c(ge.$$.fragment,e),mt=s(e),U=i(e,"DIV",{class:!0});var yt=M(U);c(_e.$$.fragment,yt),Zt=s(yt),B=i(yt,"DIV",{class:!0});var bt=M(B);c(ye.$$.fragment,bt),xt=s(bt),Ge=i(bt,"P",{"data-svelte-h":!0}),g(Ge)!=="svelte-1eed40t"&&(Ge.textContent=so),bt.forEach(o),yt.forEach(o),ut=s(e),c(be.$$.fragment,e),ht=s(e),C=i(e,"DIV",{class:!0});var Mt=M(C);c(Me.$$.fragment,Mt),Xt=s(Mt),F=i(Mt,"DIV",{class:!0});var vt=M(F);c(ve.$$.fragment,vt),Bt=s(vt),Ie=i(vt,"P",{"data-svelte-h":!0}),g(Ie)!=="svelte-1eed40t"&&(Ie.textContent=ro),vt.forEach(o),Mt.forEach(o),ft=s(e),xe=i(e,"P",{}),M(xe).forEach(o),this.h()},h(){b(f,"name","hf:doc:metadata"),b(f,"content",yo),b(z,"class","flex flex-wrap space-x-1"),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(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(T,"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(C,"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,w,t),n(e,_,t),n(e,I,t),p(W,e,t),n(e,Be,t),n(e,z,t),n(e,Fe,t),p(V,e,t),n(e,We,t),n(e,R,t),n(e,Ve,t),n(e,q,t),n(e,Re,t),n(e,N,t),n(e,qe,t),n(e,H,t),n(e,Ne,t),n(e,E,t),n(e,He,t),n(e,Q,t),n(e,Ee,t),p(Y,e,t),n(e,Qe,t),n(e,S,t),n(e,Ye,t),p(L,e,t),n(e,Se,t),n(e,D,t),n(e,Le,t),n(e,A,t),n(e,De,t),p(O,e,t),n(e,Ae,t),n(e,K,t),n(e,Oe,t),p(ee,e,t),n(e,Ke,t),n(e,te,t),n(e,et,t),p(oe,e,t),n(e,tt,t),n(e,ne,t),n(e,ot,t),p(ae,e,t),n(e,nt,t),n(e,se,t),n(e,at,t),p(re,e,t),n(e,st,t),p(ie,e,t),n(e,rt,t),n(e,v,t),p(le,v,null),l(v,wt),l(v,Pe),l(v,Tt),l(v,je),n(e,it,t),p(de,e,t),n(e,lt,t),n(e,k,t),p(ce,k,null),l(k,Pt),l(k,Z),p(pe,Z,null),l(Z,jt),l(Z,Je),n(e,dt,t),p(me,e,t),n(e,ct,t),n(e,y,t),p(ue,y,null),l(y,Jt),l(y,ke),l(y,kt),l(y,Ue),l(y,Ut),l(y,T),p(he,T,null),l(T,Ct),l(T,Ce),l(T,$t),p(x,T,null),l(y,Gt),l(y,P),p(fe,P,null),l(P,It),l(P,$e),l(P,zt),p(X,P,null),n(e,pt,t),p(ge,e,t),n(e,mt,t),n(e,U,t),p(_e,U,null),l(U,Zt),l(U,B),p(ye,B,null),l(B,xt),l(B,Ge),n(e,ut,t),p(be,e,t),n(e,ht,t),n(e,C,t),p(Me,C,null),l(C,Xt),l(C,F),p(ve,F,null),l(F,Bt),l(F,Ie),n(e,ft,t),n(e,xe,t),gt=!0},p(e,[t]){const $={};t&2&&($.$$scope={dirty:t,ctx:e}),x.$set($);const we={};t&2&&(we.$$scope={dirty:t,ctx:e}),X.$set(we)},i(e){gt||(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(ve.$$.fragment,e),gt=!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(ve.$$.fragment,e),gt=!1},d(e){e&&(o(w),o(_),o(I),o(Be),o(z),o(Fe),o(We),o(R),o(Ve),o(q),o(Re),o(N),o(qe),o(H),o(Ne),o(E),o(He),o(Q),o(Ee),o(Qe),o(S),o(Ye),o(Se),o(D),o(Le),o(A),o(De),o(Ae),o(K),o(Oe),o(Ke),o(te),o(et),o(tt),o(ne),o(ot),o(nt),o(se),o(at),o(st),o(rt),o(v),o(it),o(lt),o(k),o(dt),o(ct),o(y),o(pt),o(mt),o(U),o(ut),o(ht),o(C),o(ft),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(ve)}}}const yo='{"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 bo(Te){return po(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jo extends mo{constructor(f){super(),uo(this,f,bo,_o,co,{})}}export{Jo as component};
