import{s as et,f as Oe,n as tt,o as at}from"../chunks/scheduler.37c15a92.js";import{S as st,i as lt,g as o,s as l,r as h,A as nt,h as i,f as a,c as n,j as Re,u as m,x as r,k as p,y as ot,a as s,v as d,d as y,t as M,w}from"../chunks/index.7cb9c9b8.js";import{Y as it}from"../chunks/Youtube.8666c400.js";import{C as $e}from"../chunks/CodeBlock.abae2786.js";import{C as rt}from"../chunks/CourseFloatingBanner.df82c153.js";import{H as D,E as pt}from"../chunks/getInferenceSnippets.b6a8c7d2.js";function ct(xe){let J,K,X,P,T,O,b,ee,f,Se=`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>.`,te,U,We="We’ll cover both of these approaches shortly. But before you share your demo, you may want to polish it up 💅.",ae,j,se,g,Ze='<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"/>',le,k,Qe="To add additional content to your demo, the <code>Interface</code> class supports some optional parameters:",ne,v,He=`<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>`,oe,C,ie,I,Ye="Using the options above, we end up with a more complete interface. Try the interface below:",re,c,Fe,pe,B,ce,G,Le=`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:`,ue,R,he,$,Ne="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.",me,x,_e="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.",de,S,ye,W,ze="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?",Me,Z,Ee=`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.`,we,Q,Je,H,ge,Y,qe='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.',Te,F,Ve='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:',be,L,fe,N,Xe="Now that we have a <code>predict()</code> function. The next step is to define and launch our gradio interface:",Ue,_,je,u,Ae,ke,z,De=`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!).`,ve,E,Ke=`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.`,Ce,q,Pe="Next up, we’ll cover other ways that Gradio can be used with the Hugging Face ecosystem!",Ie,V,Be,A,Ge;return T=new D({props:{title:"Sharing demos with others",local:"sharing-demos-with-others",headingTag:"h1"}}),b=new rt({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"}]}}),j=new D({props:{title:"Polishing your Gradio demo:",local:"polishing-your-gradio-demo",headingTag:"h3"}}),C=new $e({props:{code:"dGl0bGUlMjAlM0QlMjAlMjJBc2slMjBSaWNrJTIwYSUyMFF1ZXN0aW9uJTIyJTBBZGVzY3JpcHRpb24lMjAlM0QlMjAlMjIlMjIlMjIlMEFUaGUlMjBib3QlMjB3YXMlMjB0cmFpbmVkJTIwdG8lMjBhbnN3ZXIlMjBxdWVzdGlvbnMlMjBiYXNlZCUyMG9uJTIwUmljayUyMGFuZCUyME1vcnR5JTIwZGlhbG9ndWVzLiUyMEFzayUyMFJpY2slMjBhbnl0aGluZyElMEElM0NpbWclMjBzcmMlM0QlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3BhY2VzJTJGY291cnNlLWRlbW9zJTJGUmlja19hbmRfTW9ydHlfUUElMkZyZXNvbHZlJTJGbWFpbiUyRnJpY2sucG5nJTIyJTIwd2lkdGglM0QyMDBweCUzRSUwQSUyMiUyMiUyMiUwQSUwQWFydGljbGUlMjAlM0QlMjAlMjJDaGVjayUyMG91dCUyMCU1QnRoZSUyMG9yaWdpbmFsJTIwUmljayUyMGFuZCUyME1vcnR5JTIwQm90JTVEKGh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZzcGFjZXMlMkZraW5nYWJ6cHJvJTJGUmlja19hbmRfTW9ydHlfQm90KSUyMHRoYXQlMjB0aGlzJTIwZGVtbyUyMGlzJTIwYmFzZWQlMjBvZmYlMjBvZi4lMjIlMEElMEFnci5JbnRlcmZhY2UoJTBBJTIwJTIwJTIwJTIwZm4lM0RwcmVkaWN0JTJDJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTNEJTIydGV4dGJveCUyMiUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dHMlM0QlMjJ0ZXh0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdGl0bGUlM0R0aXRsZSUyQyUwQSUyMCUyMCUyMCUyMGRlc2NyaXB0aW9uJTNEZGVzY3JpcHRpb24lMkMlMEElMjAlMjAlMjAlMjBhcnRpY2xlJTNEYXJ0aWNsZSUyQyUwQSUyMCUyMCUyMCUyMGV4YW1wbGVzJTNEJTVCJTVCJTIyV2hhdCUyMGFyZSUyMHlvdSUyMGRvaW5nJTNGJTIyJTVEJTJDJTIwJTVCJTIyV2hlcmUlMjBzaG91bGQlMjB3ZSUyMHRpbWUlMjB0cmF2ZWwlMjB0byUzRiUyMiU1RCU1RCUyQyUwQSkubGF1bmNoKCk=",highlighted:`title = <span class="hljs-string">&quot;Ask Rick 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}}),B=new D({props:{title:"Sharing your demo with temporary links",local:"sharing-your-demo-with-temporary-links",headingTag:"h3"}}),R=new $e({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}}),S=new D({props:{title:"Hosting your demo on Hugging Face Spaces",local:"hosting-your-demo-on-hugging-face-spaces",headingTag:"h3"}}),Q=new it({props:{id:"LS9Y2wDVI0k"}}),H=new D({props:{title:"✏️ Let’s apply it!",local:"lets-apply-it",headingTag:"h2"}}),L=new $e({props:{code:"ZnJvbSUyMHBhdGhsaWIlMjBpbXBvcnQlMjBQYXRoJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBncmFkaW8lMjBhcyUyMGdyJTBBZnJvbSUyMHRvcmNoJTIwaW1wb3J0JTIwbm4lMEElMEFMQUJFTFMlMjAlM0QlMjBQYXRoKCUyMmNsYXNzX25hbWVzLnR4dCUyMikucmVhZF90ZXh0KCkuc3BsaXRsaW5lcygpJTBBJTBBbW9kZWwlMjAlM0QlMjBubi5TZXF1ZW50aWFsKCUwQSUyMCUyMCUyMCUyMG5uLkNvbnYyZCgxJTJDJTIwMzIlMkMlMjAzJTJDJTIwcGFkZGluZyUzRCUyMnNhbWUlMjIpJTJDJTBBJTIwJTIwJTIwJTIwbm4uUmVMVSgpJTJDJTBBJTIwJTIwJTIwJTIwbm4uTWF4UG9vbDJkKDIpJTJDJTBBJTIwJTIwJTIwJTIwbm4uQ29udjJkKDMyJTJDJTIwNjQlMkMlMjAzJTJDJTIwcGFkZGluZyUzRCUyMnNhbWUlMjIpJTJDJTBBJTIwJTIwJTIwJTIwbm4uUmVMVSgpJTJDJTBBJTIwJTIwJTIwJTIwbm4uTWF4UG9vbDJkKDIpJTJDJTBBJTIwJTIwJTIwJTIwbm4uQ29udjJkKDY0JTJDJTIwMTI4JTJDJTIwMyUyQyUyMHBhZGRpbmclM0QlMjJzYW1lJTIyKSUyQyUwQSUyMCUyMCUyMCUyMG5uLlJlTFUoKSUyQyUwQSUyMCUyMCUyMCUyMG5uLk1heFBvb2wyZCgyKSUyQyUwQSUyMCUyMCUyMCUyMG5uLkZsYXR0ZW4oKSUyQyUwQSUyMCUyMCUyMCUyMG5uLkxpbmVhcigxMTUyJTJDJTIwMjU2KSUyQyUwQSUyMCUyMCUyMCUyMG5uLlJlTFUoKSUyQyUwQSUyMCUyMCUyMCUyMG5uLkxpbmVhcigyNTYlMkMlMjBsZW4oTEFCRUxTKSklMkMlMEEpJTBBc3RhdGVfZGljdCUyMCUzRCUyMHRvcmNoLmxvYWQoJTIycHl0b3JjaF9tb2RlbC5iaW4lMjIlMkMlMjBtYXBfbG9jYXRpb24lM0QlMjJjcHUlMjIpJTBBbW9kZWwubG9hZF9zdGF0ZV9kaWN0KHN0YXRlX2RpY3QlMkMlMjBzdHJpY3QlM0RGYWxzZSklMEFtb2RlbC5ldmFsKCklMEElMEElMEFkZWYlMjBwcmVkaWN0KGltKSUzQSUwQSUyMCUyMCUyMCUyMHglMjAlM0QlMjB0b3JjaC50ZW5zb3IoaW0lMkMlMjBkdHlwZSUzRHRvcmNoLmZsb2F0MzIpLnVuc3F1ZWV6ZSgwKS51bnNxdWVlemUoMCklMjAlMkYlMjAyNTUuMCUwQSUyMCUyMCUyMCUyMHdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXQlMjAlM0QlMjBtb2RlbCh4KSUwQSUyMCUyMCUyMCUyMHByb2JhYmlsaXRpZXMlMjAlM0QlMjB0b3JjaC5ubi5mdW5jdGlvbmFsLnNvZnRtYXgob3V0JTVCMCU1RCUyQyUyMGRpbSUzRDApJTBBJTIwJTIwJTIwJTIwdmFsdWVzJTJDJTIwaW5kaWNlcyUyMCUzRCUyMHRvcmNoLnRvcGsocHJvYmFiaWxpdGllcyUyQyUyMDUpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCTEFCRUxTJTVCaSU1RCUzQSUyMHYuaXRlbSgpJTIwZm9yJTIwaSUyQyUyMHYlMjBpbiUyMHppcChpbmRpY2VzJTJDJTIwdmFsdWVzKSU3RA==",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}}),_=new $e({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}}),V=new pt({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter9/4.mdx"}}),{c(){J=o("meta"),K=l(),X=o("p"),P=l(),h(T.$$.fragment),O=l(),h(b.$$.fragment),ee=l(),f=o("p"),f.innerHTML=Se,te=l(),U=o("p"),U.textContent=We,ae=l(),h(j.$$.fragment),se=l(),g=o("div"),g.innerHTML=Ze,le=l(),k=o("p"),k.innerHTML=Qe,ne=l(),v=o("ul"),v.innerHTML=He,oe=l(),h(C.$$.fragment),ie=l(),I=o("p"),I.textContent=Ye,re=l(),c=o("iframe"),pe=l(),h(B.$$.fragment),ce=l(),G=o("p"),G.innerHTML=Le,ue=l(),h(R.$$.fragment),he=l(),$=o("p"),$.innerHTML=Ne,me=l(),x=o("p"),x.innerHTML=_e,de=l(),h(S.$$.fragment),ye=l(),W=o("p"),W.textContent=ze,Me=l(),Z=o("p"),Z.innerHTML=Ee,we=l(),h(Q.$$.fragment),Je=l(),h(H.$$.fragment),ge=l(),Y=o("p"),Y.innerHTML=qe,Te=l(),F=o("p"),F.innerHTML=Ve,be=l(),h(L.$$.fragment),fe=l(),N=o("p"),N.innerHTML=Xe,Ue=l(),h(_.$$.fragment),je=l(),u=o("iframe"),ke=l(),z=o("p"),z.innerHTML=De,ve=l(),E=o("p"),E.innerHTML=Ke,Ce=l(),q=o("p"),q.textContent=Pe,Ie=l(),h(V.$$.fragment),Be=l(),A=o("p"),this.h()},l(e){const t=nt("svelte-u9bgzb",document.head);J=i(t,"META",{name:!0,content:!0}),t.forEach(a),K=n(e),X=i(e,"P",{}),Re(X).forEach(a),P=n(e),m(T.$$.fragment,e),O=n(e),m(b.$$.fragment,e),ee=n(e),f=i(e,"P",{"data-svelte-h":!0}),r(f)!=="svelte-1mkrhn0"&&(f.innerHTML=Se),te=n(e),U=i(e,"P",{"data-svelte-h":!0}),r(U)!=="svelte-1pmonxq"&&(U.textContent=We),ae=n(e),m(j.$$.fragment,e),se=n(e),g=i(e,"DIV",{class:!0,"data-svelte-h":!0}),r(g)!=="svelte-nclpfp"&&(g.innerHTML=Ze),le=n(e),k=i(e,"P",{"data-svelte-h":!0}),r(k)!=="svelte-2lc6cg"&&(k.innerHTML=Qe),ne=n(e),v=i(e,"UL",{"data-svelte-h":!0}),r(v)!=="svelte-1aig1l1"&&(v.innerHTML=He),oe=n(e),m(C.$$.fragment,e),ie=n(e),I=i(e,"P",{"data-svelte-h":!0}),r(I)!=="svelte-1ssl3s6"&&(I.textContent=Ye),re=n(e),c=i(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),Re(c).forEach(a),pe=n(e),m(B.$$.fragment,e),ce=n(e),G=i(e,"P",{"data-svelte-h":!0}),r(G)!=="svelte-1c70l7r"&&(G.innerHTML=Le),ue=n(e),m(R.$$.fragment,e),he=n(e),$=i(e,"P",{"data-svelte-h":!0}),r($)!=="svelte-13vn5xh"&&($.innerHTML=Ne),me=n(e),x=i(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-106y49j"&&(x.innerHTML=_e),de=n(e),m(S.$$.fragment,e),ye=n(e),W=i(e,"P",{"data-svelte-h":!0}),r(W)!=="svelte-15lxq3n"&&(W.textContent=ze),Me=n(e),Z=i(e,"P",{"data-svelte-h":!0}),r(Z)!=="svelte-1rf27a0"&&(Z.innerHTML=Ee),we=n(e),m(Q.$$.fragment,e),Je=n(e),m(H.$$.fragment,e),ge=n(e),Y=i(e,"P",{"data-svelte-h":!0}),r(Y)!=="svelte-1qf1ftl"&&(Y.innerHTML=qe),Te=n(e),F=i(e,"P",{"data-svelte-h":!0}),r(F)!=="svelte-x4hpqm"&&(F.innerHTML=Ve),be=n(e),m(L.$$.fragment,e),fe=n(e),N=i(e,"P",{"data-svelte-h":!0}),r(N)!=="svelte-1fgvly0"&&(N.innerHTML=Xe),Ue=n(e),m(_.$$.fragment,e),je=n(e),u=i(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),Re(u).forEach(a),ke=n(e),z=i(e,"P",{"data-svelte-h":!0}),r(z)!=="svelte-9yu4kr"&&(z.innerHTML=De),ve=n(e),E=i(e,"P",{"data-svelte-h":!0}),r(E)!=="svelte-otwltg"&&(E.innerHTML=Ke),Ce=n(e),q=i(e,"P",{"data-svelte-h":!0}),r(q)!=="svelte-1n58irn"&&(q.textContent=Pe),Ie=n(e),m(V.$$.fragment,e),Be=n(e),A=i(e,"P",{}),Re(A).forEach(a),this.h()},h(){p(J,"name","hf:doc:metadata"),p(J,"content",ut),p(g,"class","flex justify-center"),Oe(c.src,Fe="https://course-demos-Rick-and-Morty-QA.hf.space")||p(c,"src",Fe),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"),Oe(u.src,Ae="https://course-demos-Sketch-Recognition.hf.space")||p(u,"src",Ae),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){ot(document.head,J),s(e,K,t),s(e,X,t),s(e,P,t),d(T,e,t),s(e,O,t),d(b,e,t),s(e,ee,t),s(e,f,t),s(e,te,t),s(e,U,t),s(e,ae,t),d(j,e,t),s(e,se,t),s(e,g,t),s(e,le,t),s(e,k,t),s(e,ne,t),s(e,v,t),s(e,oe,t),d(C,e,t),s(e,ie,t),s(e,I,t),s(e,re,t),s(e,c,t),s(e,pe,t),d(B,e,t),s(e,ce,t),s(e,G,t),s(e,ue,t),d(R,e,t),s(e,he,t),s(e,$,t),s(e,me,t),s(e,x,t),s(e,de,t),d(S,e,t),s(e,ye,t),s(e,W,t),s(e,Me,t),s(e,Z,t),s(e,we,t),d(Q,e,t),s(e,Je,t),d(H,e,t),s(e,ge,t),s(e,Y,t),s(e,Te,t),s(e,F,t),s(e,be,t),d(L,e,t),s(e,fe,t),s(e,N,t),s(e,Ue,t),d(_,e,t),s(e,je,t),s(e,u,t),s(e,ke,t),s(e,z,t),s(e,ve,t),s(e,E,t),s(e,Ce,t),s(e,q,t),s(e,Ie,t),d(V,e,t),s(e,Be,t),s(e,A,t),Ge=!0},p:tt,i(e){Ge||(y(T.$$.fragment,e),y(b.$$.fragment,e),y(j.$$.fragment,e),y(C.$$.fragment,e),y(B.$$.fragment,e),y(R.$$.fragment,e),y(S.$$.fragment,e),y(Q.$$.fragment,e),y(H.$$.fragment,e),y(L.$$.fragment,e),y(_.$$.fragment,e),y(V.$$.fragment,e),Ge=!0)},o(e){M(T.$$.fragment,e),M(b.$$.fragment,e),M(j.$$.fragment,e),M(C.$$.fragment,e),M(B.$$.fragment,e),M(R.$$.fragment,e),M(S.$$.fragment,e),M(Q.$$.fragment,e),M(H.$$.fragment,e),M(L.$$.fragment,e),M(_.$$.fragment,e),M(V.$$.fragment,e),Ge=!1},d(e){e&&(a(K),a(X),a(P),a(O),a(ee),a(f),a(te),a(U),a(ae),a(se),a(g),a(le),a(k),a(ne),a(v),a(oe),a(ie),a(I),a(re),a(c),a(pe),a(ce),a(G),a(ue),a(he),a($),a(me),a(x),a(de),a(ye),a(W),a(Me),a(Z),a(we),a(Je),a(ge),a(Y),a(Te),a(F),a(be),a(fe),a(N),a(Ue),a(je),a(u),a(ke),a(z),a(ve),a(E),a(Ce),a(q),a(Ie),a(Be),a(A)),a(J),w(T,e),w(b,e),w(j,e),w(C,e),w(B,e),w(R,e),w(S,e),w(Q,e),w(H,e),w(L,e),w(_,e),w(V,e)}}}const ut='{"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 ht(xe){return at(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class gt extends st{constructor(J){super(),lt(this,J,ht,ct,et,{})}}export{gt as component};
