import{s as J,o as N,n as Q}from"../chunks/scheduler.f7e1785c.js";import{S as W,i as Z,g as c,s as p,r as G,A as ee,h,f as t,c as f,j as R,u as O,x as g,k as U,y as te,a as o,v as X,d as B,t as K,w as V,m as E,n as I}from"../chunks/index.9f8f0838.js";import{T as ne}from"../chunks/Tip.4575d9cf.js";import{H as oe}from"../chunks/Heading.6643a2f7.js";function ae(S){let i,l,y="requirements.txt",d,s,b="transformers",r,u,x="<code>git+https://github.com/hollance/transformers.git@6900e8ba6532162a8613d2270ec2286c3f58f57b</code>";return{c(){i=E(`In our experience experimenting with the Dutch language, using an MMS TTS checkpoint results in better performance than a
    fine-tuned SpeechT5 one, but you might find that your fine-tuned TTS checkpoint is preferable in your language.
    If you decide to use an MMS TTS checkpoint, you will need to update the `),l=c("a"),l.textContent=y,d=E(`
    file of your demo to install `),s=c("code"),s.textContent=b,r=E(` from the PR branch:
    `),u=c("p"),u.innerHTML=x,this.h()},l(a){i=I(a,`In our experience experimenting with the Dutch language, using an MMS TTS checkpoint results in better performance than a
    fine-tuned SpeechT5 one, but you might find that your fine-tuned TTS checkpoint is preferable in your language.
    If you decide to use an MMS TTS checkpoint, you will need to update the `),l=h(a,"A",{href:!0,"data-svelte-h":!0}),g(l)!=="svelte-l0vtp8"&&(l.textContent=y),d=I(a,`
    file of your demo to install `),s=h(a,"CODE",{"data-svelte-h":!0}),g(s)!=="svelte-olzpwg"&&(s.textContent=b),r=I(a,` from the PR branch:
    `),u=h(a,"P",{"data-svelte-h":!0}),g(u)!=="svelte-1oo2kle"&&(u.innerHTML=x),this.h()},h(){U(l,"href","https://huggingface.co/spaces/course-demos/speech-to-speech-translation/blob/a03175878f522df7445290d5508bfb5c5178f787/requirements.txt#L2")},m(a,m){o(a,i,m),o(a,l,m),o(a,d,m),o(a,s,m),o(a,r,m),o(a,u,m)},p:Q,d(a){a&&(t(i),t(l),t(d),t(s),t(r),t(u))}}}function se(S){let i,l,y,d,s,b,r,u=`In this Unit, we consolidated the material covered in the previous six units of the course to build three integrated
audio applications. As you’ve experienced, building more involved audio tools is fully within reach by using the
foundational skills you’ve acquired in this course.`,x,a,m=`The hands-on exercise takes one of the applications covered in this Unit, and extends it with a few multilingual
tweaks 🌍 Your objective is to take the <a href="https://huggingface.co/spaces/course-demos/speech-to-speech-translation" rel="nofollow">cascaded speech-to-speech translation Gradio demo</a>
from the first section in this Unit, and update it to translate to any <strong>non-English</strong> language. That is to say, the
demo should take speech in language X, and translate it to speech in language Y, where the target language Y is not
English. You should start by <a href="https://huggingface.co/spaces/course-demos/speech-to-speech-translation?duplicate=true" rel="nofollow">duplicating</a>
the template under your Hugging Face namespace. There’s no requirement to use a GPU accelerator device - the free CPU
tier works just fine 🤗 However, you should ensure that the visibility of your demo is set to <strong>public</strong>. This is required
such that your demo is accessible to us and can thus be checked for correctness.`,$,v,A=`Tips for updating the speech translation function to perform multilingual speech translation are provided in the
section on <a href="speech-to-speech">speech-to-speech translation</a>. By following these instructions, you should be able
to update the demo to translate from speech in language X to text in language Y, which is half of the task!`,H,_,j=`To synthesise from text in language Y to speech in language Y, where Y is a multilingual language, you will need
to use a multilingual TTS checkpoint. For this, you can either use the SpeechT5 TTS checkpoint that you fine-tuned
in the previous hands-on exercise, or a pre-trained multilingual TTS checkpoint. There are two options for pre-trained
checkpoints, either the checkpoint <a href="https://huggingface.co/sanchit-gandhi/speecht5_tts_vox_nl" rel="nofollow">sanchit-gandhi/speecht5_tts_vox_nl</a>,
which is a SpeechT5 checkpoint fine-tuned on the Dutch split of the <a href="https://huggingface.co/datasets/facebook/voxpopuli" rel="nofollow">VoxPopuli</a>
dataset, or an MMS TTS checkpoint (see section on <a href="../chapter6/pre-trained_models">pretrained models for TTS</a>).`,C,T,P,w,D=`Your demo should take as input an audio file, and return as output another audio file, matching the signature of the
<a href="https://huggingface.co/spaces/course-demos/speech-to-speech-translation/blob/3946ba6705a6632a63de8672ac52a482ab74b3fc/app.py#L35" rel="nofollow"><code>speech_to_speech_translation</code></a>
function in the template demo. Therefore, we recommend that you leave the main function <code>speech_to_speech_translation</code>
as is, and only update the <a href="https://huggingface.co/spaces/course-demos/speech-to-speech-translation/blob/a03175878f522df7445290d5508bfb5c5178f787/app.py#L24" rel="nofollow"><code>translate</code></a>
and <a href="https://huggingface.co/spaces/course-demos/speech-to-speech-translation/blob/a03175878f522df7445290d5508bfb5c5178f787/app.py#L29" rel="nofollow"><code>synthesise</code></a>
functions as required.`,L,k,z=`Once you have built your demo as a Gradio demo on the Hugging Face Hub, you can submit it for assessment. Head to the
Space <a href="https://huggingface.co/spaces/huggingface-course/audio-course-u7-assessment" rel="nofollow">audio-course-u7-assessment</a> and
provide the repository id of your demo when prompted. This Space will check that your demo has been built correctly by
sending a sample audio file to your demo and checking that the returned audio file is indeed non-English. If your demo
works correctly, you’ll get a green tick next to your name on the overall <a href="https://huggingface.co/spaces/MariaK/Check-my-progress-Audio-Course" rel="nofollow">progress space</a> ✅`,Y,M,q;return s=new oe({props:{title:"Hands-on exercise",local:"hands-on-exercise",headingTag:"h1"}}),T=new ne({props:{$$slots:{default:[ae]},$$scope:{ctx:S}}}),{c(){i=c("meta"),l=p(),y=c("p"),d=p(),G(s.$$.fragment),b=p(),r=c("p"),r.textContent=u,x=p(),a=c("p"),a.innerHTML=m,$=p(),v=c("p"),v.innerHTML=A,H=p(),_=c("p"),_.innerHTML=j,C=p(),G(T.$$.fragment),P=p(),w=c("p"),w.innerHTML=D,L=p(),k=c("p"),k.innerHTML=z,Y=p(),M=c("p"),this.h()},l(e){const n=ee("svelte-u9bgzb",document.head);i=h(n,"META",{name:!0,content:!0}),n.forEach(t),l=f(e),y=h(e,"P",{}),R(y).forEach(t),d=f(e),O(s.$$.fragment,e),b=f(e),r=h(e,"P",{"data-svelte-h":!0}),g(r)!=="svelte-5fgwkf"&&(r.textContent=u),x=f(e),a=h(e,"P",{"data-svelte-h":!0}),g(a)!=="svelte-1vndh8y"&&(a.innerHTML=m),$=f(e),v=h(e,"P",{"data-svelte-h":!0}),g(v)!=="svelte-1xc515h"&&(v.innerHTML=A),H=f(e),_=h(e,"P",{"data-svelte-h":!0}),g(_)!=="svelte-e3qygk"&&(_.innerHTML=j),C=f(e),O(T.$$.fragment,e),P=f(e),w=h(e,"P",{"data-svelte-h":!0}),g(w)!=="svelte-r6bgbz"&&(w.innerHTML=D),L=f(e),k=h(e,"P",{"data-svelte-h":!0}),g(k)!=="svelte-xkt7xj"&&(k.innerHTML=z),Y=f(e),M=h(e,"P",{}),R(M).forEach(t),this.h()},h(){U(i,"name","hf:doc:metadata"),U(i,"content",ie)},m(e,n){te(document.head,i),o(e,l,n),o(e,y,n),o(e,d,n),X(s,e,n),o(e,b,n),o(e,r,n),o(e,x,n),o(e,a,n),o(e,$,n),o(e,v,n),o(e,H,n),o(e,_,n),o(e,C,n),X(T,e,n),o(e,P,n),o(e,w,n),o(e,L,n),o(e,k,n),o(e,Y,n),o(e,M,n),q=!0},p(e,[n]){const F={};n&2&&(F.$$scope={dirty:n,ctx:e}),T.$set(F)},i(e){q||(B(s.$$.fragment,e),B(T.$$.fragment,e),q=!0)},o(e){K(s.$$.fragment,e),K(T.$$.fragment,e),q=!1},d(e){e&&(t(l),t(y),t(d),t(b),t(r),t(x),t(a),t($),t(v),t(H),t(_),t(C),t(P),t(w),t(L),t(k),t(Y),t(M)),t(i),V(s,e),V(T,e)}}}const ie='{"title":"Hands-on exercise","local":"hands-on-exercise","sections":[],"depth":1}';function le(S){return N(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pe extends W{constructor(i){super(),Z(this,i,le,se,J,{})}}export{pe as component};
