import{s as at,a as tt,n as lt,o as st}from"../chunks/scheduler.cc52f4b9.js";import{S as nt,i as ot,e as o,s,c as h,h as it,a as i,d as a,b as n,f as xe,g as m,j as r,k as p,l as rt,m as l,n as d,t as y,o as M,p as w}from"../chunks/index.5b747fde.js";import{C as pt,H as K,E as ct}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d38ac5a9.js";import{Y as ut}from"../chunks/Youtube.8bb4154e.js";import{C as Se}from"../chunks/CodeBlock.665bfc37.js";import{C as ht}from"../chunks/CourseFloatingBanner.b33fcd79.js";function mt(We){let J,P,A,O,T,ee,f,te,b,ae,U,Ze=`Now that you’ve built a demo, you’ll probably want to share it with others. Gradio demos
can be shared in two ways: using a <strong><em>temporary share link</em></strong> or <strong><em>permanent hosting on Spaces</em></strong>.`,le,j,Qe="We’ll cover both of these approaches shortly. But before you share your demo, you may want to polish it up 💅.",se,k,ne,g,He='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter9/gradio-demo-overview.png" alt="Overview of a gradio interface"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter9/gradio-demo-overview-dark.png" alt="Overview of a gradio interface"/>',oe,C,Ye="To add additional content to your demo, the <code>Interface</code> class supports some optional parameters:",ie,v,Fe=`<li><code>title</code>: you can give a title to your demo, which appears <em>above</em> the input and output components.</li> <li><code>description</code>: you can give a description (in text, Markdown, or HTML) for the interface, which appears above the input and output components and below the title.</li> <li><code>article</code>: you can also write an expanded article (in text, Markdown, or HTML) explaining the interface. If provided, it appears <em>below</em> the input and output components.</li> <li><code>theme</code>: don’t like the default colors? Set the theme to use one of <code>default</code>, <code>huggingface</code>, <code>grass</code>, <code>peach</code>. You can also add the <code>dark-</code> prefix, e.g. <code>dark-peach</code> for dark theme (or just <code>dark</code> for the default dark theme).</li> <li><code>examples</code>: to make your demo <em>way easier to use</em>, you can provide some example inputs for the function. These appear below the UI components and can be used to populate the interface. These should be provided as a nested list, in which the outer list consists of samples and each inner list consists of an input corresponding to each input component.</li> <li><code>live</code>: if you want to make your demo “live”, meaning that your model reruns every time the input changes, you can set <code>live=True</code>. This makes sense to use with quick models (we’ll see an example at the end of this section)
Using the options above, we end up with a more complete interface. Run the code below so you can chat with Rick and Morty:</li>`,re,I,pe,B,Le="Using the options above, we end up with a more complete interface. Try the interface below:",ce,c,Ne,ue,G,he,$,_e=`Now that we have a working demo of our machine learning model, let’s learn how to easily share a link to our interface.
Interfaces can be easily shared publicly by setting <code>share=True</code> in the <code>launch()</code> method:`,me,R,de,x,ze="This generates a public, shareable link that you can send to anybody! When you send this link, the user on the other side can try out the model in their browser for up to 72 hours. Because the processing happens on your device (as long as your device stays on!), you don’t have to worry about packaging any dependencies. If you’re working out of a Google Colab notebook, a share link is always automatically created. It usually looks something like this: <strong>XXXXX.gradio.app</strong>. Although the link is served through a Gradio link, we are only a proxy for your local server, and do not store any data sent through the interfaces.",ye,S,Ee="Keep in mind, however, that these links are publicly accessible, meaning that anyone can use your model for prediction! Therefore, make sure not to expose any sensitive information through the functions you write, or allow any critical changes to occur on your device. If you set <code>share=False</code> (the default), only a local link is created.",Me,W,we,Z,qe="A share link that you can pass around to collegues is cool, but how can you permanently host your demo and have it exist in its own “space” on the internet?",Je,Q,Ve=`Hugging Face Spaces provides the infrastructure to permanently host your Gradio model on the internet, <strong>for free</strong>! Spaces allows you to create and push to a (public or private) repo,
where your Gradio
interface code will exist in an <code>app.py</code> file. <a href="https://huggingface.co/blog/gradio-spaces" rel="nofollow">Read a step-by-step tutorial</a> to get started, or watch an example video below.`,ge,H,Te,Y,fe,F,Xe='Using what we just learned in the sections so far, let’s create the sketch recognition demo we saw in <a href="/course/chapter9/1">section one of this chapter</a>. Let’s add some customization to our interface and set <code>share=True</code> to create a public link we can pass around.',be,L,Ae='We can load the labels from <a href="https://huggingface.co/spaces/dawood/Sketch-Recognition/blob/main/class_names.txt" rel="nofollow">class_names.txt</a> and load the pre-trained pytorch model from <a href="https://huggingface.co/spaces/dawood/Sketch-Recognition/blob/main/pytorch_model.bin" rel="nofollow">pytorch_model.bin</a>. Download these files by following the link and clicking download on the top left corner of the file preview. Let’s take a look at the code below to see how we use these files to load our model and create a <code>predict()</code> function:',Ue,N,je,_,De="Now that we have a <code>predict()</code> function. The next step is to define and launch our gradio interface:",ke,z,Ce,u,Ke,ve,E,Pe=`Notice the <code>live=True</code> parameter in <code>Interface</code>, which means that the sketch demo makes
a prediction every time someone draws on the sketchpad (no submit button!).`,Ie,q,Oe=`Furthermore, we also set the <code>share=True</code> argument in the <code>launch()</code> method.
This will create a public link that you can
send to anyone! When you send this link, the user on the other side can try out the
sketch recognition model. To reiterate, you could also host the model on Hugging Face Spaces,
which is how we are able to embed the demo above.`,Be,V,et="Next up, we’ll cover other ways that Gradio can be used with the Hugging Face ecosystem!",Ge,X,$e,D,Re;return T=new pt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new K({props:{title:"Sharing demos with others",local:"sharing-demos-with-others",headingTag:"h1"}}),b=new ht({props:{chapter:9,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter9/section4.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter9/section4.ipynb"}]}}),k=new K({props:{title:"Polishing your Gradio demo:",local:"polishing-your-gradio-demo",headingTag:"h3"}}),I=new Se({props:{code:"dGl0bGUlMjAlM0QlMjAlMjJBc2slMjBSaWNrJTIwYSUyMFF1ZXN0aW9uJTIyJTBBZGVzY3JpcHRpb24lMjAlM0QlMjAlMjIlMjIlMjIlMEFUaGUlMjBib3QlMjB3YXMlMjB0cmFpbmVkJTIwdG8lMjBhbnN3ZXIlMjBxdWVzdGlvbnMlMjBiYXNlZCUyMG9uJTIwUmljayUyMGFuZCUyME1vcnR5JTIwZGlhbG9ndWVzLiUyMEFz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a Question&quot;</span>
description = <span class="hljs-string">&quot;&quot;&quot;
The bot was trained to answer questions based on Rick and Morty dialogues. Ask Rick anything!
&lt;img src=&quot;https://huggingface.co/spaces/course-demos/Rick_and_Morty_QA/resolve/main/rick.png&quot; width=200px&gt;
&quot;&quot;&quot;</span>

article = <span class="hljs-string">&quot;Check out [the original Rick and Morty Bot](https://huggingface.co/spaces/kingabzpro/Rick_and_Morty_Bot) that this demo is based off of.&quot;</span>

gr.Interface(
    fn=predict,
    inputs=<span class="hljs-string">&quot;textbox&quot;</span>,
    outputs=<span class="hljs-string">&quot;text&quot;</span>,
    title=title,
    description=description,
    article=article,
    examples=[[<span class="hljs-string">&quot;What are you doing?&quot;</span>], [<span class="hljs-string">&quot;Where should we time travel to?&quot;</span>]],
).launch()`,wrap:!1}}),G=new K({props:{title:"Sharing your demo with temporary links",local:"sharing-your-demo-with-temporary-links",headingTag:"h3"}}),R=new Se({props:{code:"Z3IuSW50ZXJmYWNlKGNsYXNzaWZ5X2ltYWdlJTJDJTIwJTIyaW1hZ2UlMjIlMkMlMjAlMjJsYWJlbCUyMikubGF1bmNoKHNoYXJlJTNEVHJ1ZSk=",highlighted:'gr.Interface(classify_image, <span class="hljs-string">&quot;image&quot;</span>, <span class="hljs-string">&quot;label&quot;</span>).launch(share=<span class="hljs-literal">True</span>)',wrap:!1}}),W=new K({props:{title:"Hosting your demo on Hugging Face Spaces",local:"hosting-your-demo-on-hugging-face-spaces",headingTag:"h3"}}),H=new ut({props:{id:"LS9Y2wDVI0k"}}),Y=new K({props:{title:"✏️ Let’s apply it!",local:"lets-apply-it",headingTag:"h2"}}),N=new Se({props:{code:"ZnJvbSUyMHBhdGhsaWIlMjBpbXBvcnQlMjBQYXRoJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBncmFkaW8lMjBhcyUyMGdyJTBBZnJvbSUyMHRvcmNoJTIwaW1wb3J0JTIwbm4lMEElMEFMQUJFTFMlMjAlM0QlMjBQYXRoKCUyMmNs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CklMEElMEElMEFkZWYlMjBwcmVkaWN0KGltKSUzQSUwQSUyMCUyMCUyMCUyMHglMjAlM0QlMjB0b3JjaC50ZW5zb3IoaW0lMkMlMjBkdHlwZSUzRHRvcmNoLmZsb2F0MzIpLnVuc3F1ZWV6ZSgwKS51bnNxdWVlemUoMCklMjAlMkYlMjAyNTUuMCUwQSUyMCUyMCUyMCUyMHdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXQlMjAlM0QlMjBtb2RlbCh4KSUwQSUyMCUyMCUyMCUyMHByb2JhYmlsaXRpZXMlMjAlM0QlMjB0b3JjaC5ubi5mdW5jdGlvbmFsLnNvZnRtYXgob3V0JTVCMCU1RCUyQyUyMGRpbSUzRDApJTBBJTIwJTIwJTIwJTIwdmFsdWVzJTJDJTIwaW5kaWNlcyUyMCUzRCUyMHRvcmNoLnRvcGsocHJvYmFiaWxpdGllcyUyQyUyMDUpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCTEFCRUxTJTVCaSU1RCUzQSUyMHYuaXRlbSgpJTIwZm9yJTIwaSUyQyUyMHYlMjBpbiUyMHppcChpbmRpY2VzJTJDJTIwdmFsdWVzKSU3RA==",highlighted:`<span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr
<span class="hljs-keyword">from</span> torch <span class="hljs-keyword">import</span> nn

LABELS = Path(<span class="hljs-string">&quot;class_names.txt&quot;</span>).read_text().splitlines()

model = nn.Sequential(
    nn.Conv2d(<span class="hljs-number">1</span>, <span class="hljs-number">32</span>, <span class="hljs-number">3</span>, padding=<span class="hljs-string">&quot;same&quot;</span>),
    nn.ReLU(),
    nn.MaxPool2d(<span class="hljs-number">2</span>),
    nn.Conv2d(<span class="hljs-number">32</span>, <span class="hljs-number">64</span>, <span class="hljs-number">3</span>, padding=<span class="hljs-string">&quot;same&quot;</span>),
    nn.ReLU(),
    nn.MaxPool2d(<span class="hljs-number">2</span>),
    nn.Conv2d(<span class="hljs-number">64</span>, <span class="hljs-number">128</span>, <span class="hljs-number">3</span>, padding=<span class="hljs-string">&quot;same&quot;</span>),
    nn.ReLU(),
    nn.MaxPool2d(<span class="hljs-number">2</span>),
    nn.Flatten(),
    nn.Linear(<span class="hljs-number">1152</span>, <span class="hljs-number">256</span>),
    nn.ReLU(),
    nn.Linear(<span class="hljs-number">256</span>, <span class="hljs-built_in">len</span>(LABELS)),
)
state_dict = torch.load(<span class="hljs-string">&quot;pytorch_model.bin&quot;</span>, map_location=<span class="hljs-string">&quot;cpu&quot;</span>)
model.load_state_dict(state_dict, strict=<span class="hljs-literal">False</span>)
model.<span class="hljs-built_in">eval</span>()


<span class="hljs-keyword">def</span> <span class="hljs-title function_">predict</span>(<span class="hljs-params">im</span>):
    x = torch.tensor(im, dtype=torch.float32).unsqueeze(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>) / <span class="hljs-number">255.0</span>
    <span class="hljs-keyword">with</span> torch.no_grad():
        out = model(x)
    probabilities = torch.nn.functional.softmax(out[<span class="hljs-number">0</span>], dim=<span class="hljs-number">0</span>)
    values, indices = torch.topk(probabilities, <span class="hljs-number">5</span>)
    <span class="hljs-keyword">return</span> {LABELS[i]: v.item() <span class="hljs-keyword">for</span> i, v <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(indices, values)}`,wrap:!1}}),z=new Se({props:{code:"aW50ZXJmYWNlJTIwJTNEJTIwZ3IuSW50ZXJmYWNlKCUwQSUyMCUyMCUyMCUyMHByZWRpY3QlMkMlMEElMjAlMjAlMjAlMjBpbnB1dHMlM0QlMjJza2V0Y2hwYWQlMjIlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRzJTNEJTIybGFiZWwlMjIlMkMlMEElMjAlMjAlMjAlMjB0aGVtZSUzRCUyMmh1Z2dpbmdmYWNlJTIyJTJDJTBBJTIwJTIwJTIwJTIwdGl0bGUlM0QlMjJTa2V0Y2glMjBSZWNvZ25pdGlvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMGRlc2NyaXB0aW9uJTNEJTIyV2hvJTIwd2FudHMlMjB0byUyMHBsYXklMjBQaWN0aW9uYXJ5JTNGJTIwRHJhdyUyMGElMjBjb21tb24lMjBvYmplY3QlMjBsaWtlJTIwYSUyMHNob3ZlbCUyMG9yJTIwYSUyMGxhcHRvcCUyQyUyMGFuZCUyMHRoZSUyMGFsZ29yaXRobSUyMHdpbGwlMjBndWVzcyUyMGluJTIwcmVhbCUyMHRpbWUhJTIyJTJDJTBBJTIwJTIwJTIwJTIwYXJ0aWNsZSUzRCUyMiUzQ3AlMjBzdHlsZSUzRCd0ZXh0LWFsaWduJTNBJTIwY2VudGVyJyUzRVNrZXRjaCUyMFJlY29nbml0aW9uJTIwJTdDJTIwRGVtbyUyME1vZGVsJTNDJTJGcCUzRSUyMiUyQyUwQSUyMCUyMCUyMCUyMGxpdmUlM0RUcnVlJTJDJTBBKSUwQWludGVyZmFjZS5sYXVuY2goc2hhcmUlM0RUcnVlKQ==",highlighted:`interface = gr.Interface(
    predict,
    inputs=<span class="hljs-string">&quot;sketchpad&quot;</span>,
    outputs=<span class="hljs-string">&quot;label&quot;</span>,
    theme=<span class="hljs-string">&quot;huggingface&quot;</span>,
    title=<span class="hljs-string">&quot;Sketch Recognition&quot;</span>,
    description=<span class="hljs-string">&quot;Who wants to play Pictionary? Draw a common object like a shovel or a laptop, and the algorithm will guess in real time!&quot;</span>,
    article=<span class="hljs-string">&quot;&lt;p style=&#x27;text-align: center&#x27;&gt;Sketch Recognition | Demo Model&lt;/p&gt;&quot;</span>,
    live=<span class="hljs-literal">True</span>,
)
interface.launch(share=<span class="hljs-literal">True</span>)`,wrap:!1}}),X=new ct({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter9/4.mdx"}}),{c(){J=o("meta"),P=s(),A=o("p"),O=s(),h(T.$$.fragment),ee=s(),h(f.$$.fragment),te=s(),h(b.$$.fragment),ae=s(),U=o("p"),U.innerHTML=Ze,le=s(),j=o("p"),j.textContent=Qe,se=s(),h(k.$$.fragment),ne=s(),g=o("div"),g.innerHTML=He,oe=s(),C=o("p"),C.innerHTML=Ye,ie=s(),v=o("ul"),v.innerHTML=Fe,re=s(),h(I.$$.fragment),pe=s(),B=o("p"),B.textContent=Le,ce=s(),c=o("iframe"),ue=s(),h(G.$$.fragment),he=s(),$=o("p"),$.innerHTML=_e,me=s(),h(R.$$.fragment),de=s(),x=o("p"),x.innerHTML=ze,ye=s(),S=o("p"),S.innerHTML=Ee,Me=s(),h(W.$$.fragment),we=s(),Z=o("p"),Z.textContent=qe,Je=s(),Q=o("p"),Q.innerHTML=Ve,ge=s(),h(H.$$.fragment),Te=s(),h(Y.$$.fragment),fe=s(),F=o("p"),F.innerHTML=Xe,be=s(),L=o("p"),L.innerHTML=Ae,Ue=s(),h(N.$$.fragment),je=s(),_=o("p"),_.innerHTML=De,ke=s(),h(z.$$.fragment),Ce=s(),u=o("iframe"),ve=s(),E=o("p"),E.innerHTML=Pe,Ie=s(),q=o("p"),q.innerHTML=Oe,Be=s(),V=o("p"),V.textContent=et,Ge=s(),h(X.$$.fragment),$e=s(),D=o("p"),this.h()},l(e){const t=it("svelte-u9bgzb",document.head);J=i(t,"META",{name:!0,content:!0}),t.forEach(a),P=n(e),A=i(e,"P",{}),xe(A).forEach(a),O=n(e),m(T.$$.fragment,e),ee=n(e),m(f.$$.fragment,e),te=n(e),m(b.$$.fragment,e),ae=n(e),U=i(e,"P",{"data-svelte-h":!0}),r(U)!=="svelte-1mkrhn0"&&(U.innerHTML=Ze),le=n(e),j=i(e,"P",{"data-svelte-h":!0}),r(j)!=="svelte-1pmonxq"&&(j.textContent=Qe),se=n(e),m(k.$$.fragment,e),ne=n(e),g=i(e,"DIV",{class:!0,"data-svelte-h":!0}),r(g)!=="svelte-nclpfp"&&(g.innerHTML=He),oe=n(e),C=i(e,"P",{"data-svelte-h":!0}),r(C)!=="svelte-2lc6cg"&&(C.innerHTML=Ye),ie=n(e),v=i(e,"UL",{"data-svelte-h":!0}),r(v)!=="svelte-1aig1l1"&&(v.innerHTML=Fe),re=n(e),m(I.$$.fragment,e),pe=n(e),B=i(e,"P",{"data-svelte-h":!0}),r(B)!=="svelte-1ssl3s6"&&(B.textContent=Le),ce=n(e),c=i(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),xe(c).forEach(a),ue=n(e),m(G.$$.fragment,e),he=n(e),$=i(e,"P",{"data-svelte-h":!0}),r($)!=="svelte-1c70l7r"&&($.innerHTML=_e),me=n(e),m(R.$$.fragment,e),de=n(e),x=i(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-13vn5xh"&&(x.innerHTML=ze),ye=n(e),S=i(e,"P",{"data-svelte-h":!0}),r(S)!=="svelte-106y49j"&&(S.innerHTML=Ee),Me=n(e),m(W.$$.fragment,e),we=n(e),Z=i(e,"P",{"data-svelte-h":!0}),r(Z)!=="svelte-15lxq3n"&&(Z.textContent=qe),Je=n(e),Q=i(e,"P",{"data-svelte-h":!0}),r(Q)!=="svelte-1rf27a0"&&(Q.innerHTML=Ve),ge=n(e),m(H.$$.fragment,e),Te=n(e),m(Y.$$.fragment,e),fe=n(e),F=i(e,"P",{"data-svelte-h":!0}),r(F)!=="svelte-1qf1ftl"&&(F.innerHTML=Xe),be=n(e),L=i(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-x4hpqm"&&(L.innerHTML=Ae),Ue=n(e),m(N.$$.fragment,e),je=n(e),_=i(e,"P",{"data-svelte-h":!0}),r(_)!=="svelte-1fgvly0"&&(_.innerHTML=De),ke=n(e),m(z.$$.fragment,e),Ce=n(e),u=i(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),xe(u).forEach(a),ve=n(e),E=i(e,"P",{"data-svelte-h":!0}),r(E)!=="svelte-9yu4kr"&&(E.innerHTML=Pe),Ie=n(e),q=i(e,"P",{"data-svelte-h":!0}),r(q)!=="svelte-otwltg"&&(q.innerHTML=Oe),Be=n(e),V=i(e,"P",{"data-svelte-h":!0}),r(V)!=="svelte-1n58irn"&&(V.textContent=et),Ge=n(e),m(X.$$.fragment,e),$e=n(e),D=i(e,"P",{}),xe(D).forEach(a),this.h()},h(){p(J,"name","hf:doc:metadata"),p(J,"content",dt),p(g,"class","flex justify-center"),tt(c.src,Ne="https://course-demos-Rick-and-Morty-QA.hf.space")||p(c,"src",Ne),p(c,"frameborder","0"),p(c,"height","800"),p(c,"title","Gradio app"),p(c,"class","container p-0 flex-grow space-iframe"),p(c,"allow","accelerometer; ambient-light-sensor; autoplay; battery; camera; document-domain; encrypted-media; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; vr ; wake-lock; xr-spatial-tracking"),p(c,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"),tt(u.src,Ke="https://course-demos-Sketch-Recognition.hf.space")||p(u,"src",Ke),p(u,"frameborder","0"),p(u,"height","650"),p(u,"title","Gradio app"),p(u,"class","container p-0 flex-grow space-iframe"),p(u,"allow","accelerometer; ambient-light-sensor; autoplay; battery; camera; document-domain; encrypted-media; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; vr ; wake-lock; xr-spatial-tracking"),p(u,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads")},m(e,t){rt(document.head,J),l(e,P,t),l(e,A,t),l(e,O,t),d(T,e,t),l(e,ee,t),d(f,e,t),l(e,te,t),d(b,e,t),l(e,ae,t),l(e,U,t),l(e,le,t),l(e,j,t),l(e,se,t),d(k,e,t),l(e,ne,t),l(e,g,t),l(e,oe,t),l(e,C,t),l(e,ie,t),l(e,v,t),l(e,re,t),d(I,e,t),l(e,pe,t),l(e,B,t),l(e,ce,t),l(e,c,t),l(e,ue,t),d(G,e,t),l(e,he,t),l(e,$,t),l(e,me,t),d(R,e,t),l(e,de,t),l(e,x,t),l(e,ye,t),l(e,S,t),l(e,Me,t),d(W,e,t),l(e,we,t),l(e,Z,t),l(e,Je,t),l(e,Q,t),l(e,ge,t),d(H,e,t),l(e,Te,t),d(Y,e,t),l(e,fe,t),l(e,F,t),l(e,be,t),l(e,L,t),l(e,Ue,t),d(N,e,t),l(e,je,t),l(e,_,t),l(e,ke,t),d(z,e,t),l(e,Ce,t),l(e,u,t),l(e,ve,t),l(e,E,t),l(e,Ie,t),l(e,q,t),l(e,Be,t),l(e,V,t),l(e,Ge,t),d(X,e,t),l(e,$e,t),l(e,D,t),Re=!0},p:lt,i(e){Re||(y(T.$$.fragment,e),y(f.$$.fragment,e),y(b.$$.fragment,e),y(k.$$.fragment,e),y(I.$$.fragment,e),y(G.$$.fragment,e),y(R.$$.fragment,e),y(W.$$.fragment,e),y(H.$$.fragment,e),y(Y.$$.fragment,e),y(N.$$.fragment,e),y(z.$$.fragment,e),y(X.$$.fragment,e),Re=!0)},o(e){M(T.$$.fragment,e),M(f.$$.fragment,e),M(b.$$.fragment,e),M(k.$$.fragment,e),M(I.$$.fragment,e),M(G.$$.fragment,e),M(R.$$.fragment,e),M(W.$$.fragment,e),M(H.$$.fragment,e),M(Y.$$.fragment,e),M(N.$$.fragment,e),M(z.$$.fragment,e),M(X.$$.fragment,e),Re=!1},d(e){e&&(a(P),a(A),a(O),a(ee),a(te),a(ae),a(U),a(le),a(j),a(se),a(ne),a(g),a(oe),a(C),a(ie),a(v),a(re),a(pe),a(B),a(ce),a(c),a(ue),a(he),a($),a(me),a(de),a(x),a(ye),a(S),a(Me),a(we),a(Z),a(Je),a(Q),a(ge),a(Te),a(fe),a(F),a(be),a(L),a(Ue),a(je),a(_),a(ke),a(Ce),a(u),a(ve),a(E),a(Ie),a(q),a(Be),a(V),a(Ge),a($e),a(D)),a(J),w(T,e),w(f,e),w(b,e),w(k,e),w(I,e),w(G,e),w(R,e),w(W,e),w(H,e),w(Y,e),w(N,e),w(z,e),w(X,e)}}}const dt='{"title":"Sharing demos with others","local":"sharing-demos-with-others","sections":[{"title":"Polishing your Gradio demo:","local":"polishing-your-gradio-demo","sections":[],"depth":3},{"title":"Sharing your demo with temporary links","local":"sharing-your-demo-with-temporary-links","sections":[],"depth":3},{"title":"Hosting your demo on Hugging Face Spaces","local":"hosting-your-demo-on-hugging-face-spaces","sections":[],"depth":3},{"title":"✏️ Let’s apply it!","local":"lets-apply-it","sections":[],"depth":2}],"depth":1}';function yt(We){return st(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bt extends nt{constructor(J){super(),ot(this,J,yt,mt,at,{})}}export{bt as component};
