import{s as el,f as Oe,n as ll,o as tl}from"../chunks/scheduler.37c15a92.js";import{S as sl,i as al,g as i,s as a,r as m,A as nl,h as o,f as t,c as n,j as Re,u,x as p,k as c,y as il,a as s,v as y,d,t as J,w as T}from"../chunks/index.2bf4358c.js";import{Y as ol}from"../chunks/Youtube.1e50a667.js";import{C as $e}from"../chunks/CodeBlock.4f5fc1ad.js";import{D as pl}from"../chunks/DocNotebookDropdown.d9dfeb24.js";import{H as D,E as cl}from"../chunks/EditOnGithub.8916dc7c.js";function rl(Se){let U,K,X,P,w,O,b,ee,g,We=`现在您已经构建了一个演示，您可能希望与其他人分享它。 梯度演示
可以通过两种方式共享：使用 <strong><em>temporary share link</em></strong> 或 <strong><em>permanent hosting on Spaces</em></strong>。`,le,j,Ze="我们将很快介绍这两种方法。 但在分享演示之前，您可能需要完善它 💅.",te,f,se,h,Qe='<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"/>',ae,C,He="为了给你的演示添加额外的内容，<code>Interface</code> 类支持一些可选参数：",ne,I,xe=`<li><code>title</code>：你可以给你的演示一个标题，它出现在输入和输出组件的上方。</li> <li><code>description</code>：您可以为界面提供描述（文本、Markdown 或 HTML），显示在输入和输出组件的上方和标题下方。</li> <li><code>article</code>：您还可以编写扩展文章（文本、Markdown 或 HTML）来解释界面。如果提供，它会出现在输入和输出组件的_下方。</li> <li><code>theme</code>：不喜欢默认颜色？将主题设置为使用 <code>default</code>、<code>huggingface</code>、<code>grass</code>、<code>peach</code> 之一。您还可以添加 <code>dark-</code> 前缀，例如<code>dark-peach</code> 用于深色主题（或者只是 <code>dark</code> 用于默认的深色主题）。</li> <li><code>examples</code>：为了让您的演示<em>更易于使用</em>，您可以为函数提供一些示例输入。它们出现在 UI 组件下方，可用于填充界面。这些应该作为嵌套列表提供，其中外部列表​​由样本组成，每个内部列表对应于每个输入组件的输入组成。</li> <li><code>live</code>：如果你想让你的演示“活”，这意味着你的模型每次输入更改时都会重新运行，你可以设置 <code>live=True</code>。这对使用快速模型很有意义（我们将在本节末尾看到一个示例）
使用上面的选项，我们最终得到了一个更完整的界面。 运行下面的代码，以便与 Rick and Morty 聊天：</li>`,ie,k,oe,v,Ye="使用上面的选项，我们最终得到了一个更完整的界面。 试试下面的界面：",pe,r,Fe,ce,B,re,G,_e=`现在我们已经有了机器学习模型的工作演示，让我们学习如何轻松共享指向我们界面的链接。
通过在 <code>launch()</code> 方法中设置 <code>share=True</code> 可以轻松地公开共享接口：`,Me,R,me,$,ze="这会生成一个公开的、可共享的链接，您可以将其发送给任何人！ 当您发送此链接时，另一方的用户可以在浏览器中试用该模型长达 72 小时。 因为处理发生在您的设备上（只要您的设备保持开启！），您不必担心打包任何依赖项。 如果您使用 Google Colab 笔记本工作，则始终会自动创建共享链接。 它通常看起来像这样：<strong>XXXXX.gradio.app</strong>。 虽然链接是通过 Gradio 链接提供的，但我们只是您本地服务器的代理，不会存储通过接口发送的任何数据。",ue,S,Ee="但是请记住，这些链接是可公开访问的，这意味着任何人都可以使用您的模型进行预测！ 因此，请确保不要通过您编写的函数公开任何敏感信息，或允许在您的设备上发生任何关键更改。 如果设置 <code>share=False</code>（默认值），则仅创建本地链接。",ye,W,de,Z,Ne="可以传递给同事的共享链接很酷，但是如何永久托管您的演示并让它存在于互联网上自己的“空间”中？",Je,Q,Le=`Hugging Face Spaces 提供了在互联网上永久托管 Gradio 模型的基础设施，<strong>免费</strong>！ Spaces 允许您创建并推送到（公共或私人）存储库，
你的 Gradio 在哪里
接口代码将存在于 <code>app.py</code> 文件中。 <a href="https://huggingface.co/blog/gradio-spaces" rel="nofollow">阅读分步教程</a> 开始使用，或观看下面的示例视频。`,Te,H,Ue,x,he,Y,Ve='使用到目前为止我们在各节中学到的知识，让我们创建我们在<a href="/course/chapter9/1">本章第一节</a>中看到的草图识别演示。 让我们为我们的界面添加一些自定义并设置 <code>share=True</code> 以创建一个我们可以传递的公共链接。',we,F,qe='我们可以从 <a href="https://huggingface.co/spaces/dawood/Sketch-Recognition/blob/main/class_names.txt" rel="nofollow">class_names.txt</a> 加载标签，并从 <a href="https://huggingface.co/spaces/dawood/Sketch-Recognition/blob/main/pytorch_model.bin" rel="nofollow">pytorch_model.bin</a>加载预训练的 pytorch 模型 。 通过点击链接并单击文件预览左上角的下载来下载这些文件。 让我们看看下面的代码，看看我们如何使用这些文件来加载我们的模型并创建一个<code>predict()</code>函数：',be,_,ge,z,Xe="现在我们有了一个<code>predict()</code>函数。 下一步是定义并启动我们的渐变界面：",je,E,fe,M,Ae,Ce,N,De=`注意 <code>Interface</code> 中的 <code>live=True</code> 参数，这意味着草图演示使
每次有人在画板上画画时的预测（没有提交按钮！）。`,Ie,L,Ke=`此外，我们还在 <code>launch()</code> 方法中设置了 <code>share=True</code> 参数。
这将创建一个公共链接，您可以发送给任何人！ 当您发送此链接时，对方的用户可以尝试草图识别模型。 重申一下，您还可以在 Hugging Face Spaces 上托管模型，这就是我们能够嵌入上面的演示的方式。`,ke,V,Pe="接下来，我们将介绍 Gradio 可用于 Hugging Face 生态系统的其他方式！",ve,q,Be,A,Ge;return w=new D({props:{title:"与他人分享演示",local:"与他人分享演示",headingTag:"h1"}}),b=new pl({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/chapter9/section4.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/chapter9/section4.ipynb"}]}}),f=new D({props:{title:"打磨你的 Gradio 演示:",local:"打磨你的 Gradio 演示:",headingTag:"h3"}}),k=new $e({props:{code:"dGl0bGUlMjAlM0QlMjAlMjJBc2slMjBSaWNrJTIwYSUyMFF1ZXN0aW9uJTIyJTBBZGVzY3JpcHRpb24lM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dSUyMGRvaW5nJTNGJTIyJTVEJTJDJTIwJTVCJTIyV2hlcmUlMjBzaG91bGQlMjB3ZSUyMHRpbWUlMjB0cmF2ZWwlMjB0byUzRiUyMiU1RCU1RCUyQyUwQSkubGF1bmNoKCk=",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:"使用临时链接分享您的演示",local:"使用临时链接分享您的演示",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}}),W=new D({props:{title:"在 Hugging Face Spaces 上托管您的演示",local:"在 Hugging Face Spaces 上托管您的演示",headingTag:"h3"}}),H=new ol({props:{id:"LS9Y2wDVI0k"}}),x=new D({props:{title:"✏️ 让我们应用它!",local:"✏️ 让我们应用它!",headingTag:"h2"}}),_=new $e({props:{code:"ZnJvbSUyMHBhdGh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JTIycHl0b3JjaF9tb2RlbC5iaW4lMjIlMkMlMjBtYXBfbG9jYXRpb24lM0QlMjJjcHUlMjIpJTBBbW9kZWwubG9hZF9zdGF0ZV9kaWN0KHN0YXRlX2RpY3QlMkMlMjBzdHJpY3QlM0RGYWxzZSklMEFtb2RlbC5ldmFsKCklMEElMEElMEFkZWYlMjBwcmVkaWN0KGltKSUzQSUwQSUyMCUyMCUyMCUyMHglMjAlM0QlMjB0b3JjaC50ZW5zb3IoaW0lMkMlMjBkdHlwZSUzRHRvcmNoLmZsb2F0MzIpLnVuc3F1ZWV6ZSgwKS51bnNxdWVlemUoMCklMjAlMkYlMjAyNTUuMCUwQSUyMCUyMCUyMCUyMHdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXQlMjAlM0QlMjBtb2RlbCh4KSUwQSUyMCUyMCUyMCUyMHByb2JhYmlsaXRpZXMlMjAlM0QlMjB0b3JjaC5ubi5mdW5jdGlvbmFsLnNvZnRtYXgob3V0JTVCMCU1RCUyQyUyMGRpbSUzRDApJTBBJTIwJTIwJTIwJTIwdmFsdWVzJTJDJTIwaW5kaWNlcyUyMCUzRCUyMHRvcmNoLnRvcGsocHJvYmFiaWxpdGllcyUyQyUyMDUpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCTEFCRUxTJTVCaSU1RCUzQSUyMHYuaXRlbSgpJTIwZm9yJTIwaSUyQyUyMHYlMjBpbiUyMHppcChpbmRpY2VzJTJDJTIwdmFsdWVzKSU3RA==",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}}),E=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}}),q=new cl({props:{source:"https://github.com/huggingface/course/blob/main/chapters/zh-CN/chapter9/4.mdx"}}),{c(){U=i("meta"),K=a(),X=i("p"),P=a(),m(w.$$.fragment),O=a(),m(b.$$.fragment),ee=a(),g=i("p"),g.innerHTML=We,le=a(),j=i("p"),j.textContent=Ze,te=a(),m(f.$$.fragment),se=a(),h=i("div"),h.innerHTML=Qe,ae=a(),C=i("p"),C.innerHTML=He,ne=a(),I=i("ul"),I.innerHTML=xe,ie=a(),m(k.$$.fragment),oe=a(),v=i("p"),v.textContent=Ye,pe=a(),r=i("iframe"),ce=a(),m(B.$$.fragment),re=a(),G=i("p"),G.innerHTML=_e,Me=a(),m(R.$$.fragment),me=a(),$=i("p"),$.innerHTML=ze,ue=a(),S=i("p"),S.innerHTML=Ee,ye=a(),m(W.$$.fragment),de=a(),Z=i("p"),Z.textContent=Ne,Je=a(),Q=i("p"),Q.innerHTML=Le,Te=a(),m(H.$$.fragment),Ue=a(),m(x.$$.fragment),he=a(),Y=i("p"),Y.innerHTML=Ve,we=a(),F=i("p"),F.innerHTML=qe,be=a(),m(_.$$.fragment),ge=a(),z=i("p"),z.innerHTML=Xe,je=a(),m(E.$$.fragment),fe=a(),M=i("iframe"),Ce=a(),N=i("p"),N.innerHTML=De,Ie=a(),L=i("p"),L.innerHTML=Ke,ke=a(),V=i("p"),V.textContent=Pe,ve=a(),m(q.$$.fragment),Be=a(),A=i("p"),this.h()},l(e){const l=nl("svelte-u9bgzb",document.head);U=o(l,"META",{name:!0,content:!0}),l.forEach(t),K=n(e),X=o(e,"P",{}),Re(X).forEach(t),P=n(e),u(w.$$.fragment,e),O=n(e),u(b.$$.fragment,e),ee=n(e),g=o(e,"P",{"data-svelte-h":!0}),p(g)!=="svelte-bey4o8"&&(g.innerHTML=We),le=n(e),j=o(e,"P",{"data-svelte-h":!0}),p(j)!=="svelte-l5jkrx"&&(j.textContent=Ze),te=n(e),u(f.$$.fragment,e),se=n(e),h=o(e,"DIV",{class:!0,"data-svelte-h":!0}),p(h)!=="svelte-nclpfp"&&(h.innerHTML=Qe),ae=n(e),C=o(e,"P",{"data-svelte-h":!0}),p(C)!=="svelte-vfq66l"&&(C.innerHTML=He),ne=n(e),I=o(e,"UL",{"data-svelte-h":!0}),p(I)!=="svelte-e48ebq"&&(I.innerHTML=xe),ie=n(e),u(k.$$.fragment,e),oe=n(e),v=o(e,"P",{"data-svelte-h":!0}),p(v)!=="svelte-i5q7ey"&&(v.textContent=Ye),pe=n(e),r=o(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),Re(r).forEach(t),ce=n(e),u(B.$$.fragment,e),re=n(e),G=o(e,"P",{"data-svelte-h":!0}),p(G)!=="svelte-1kxovp3"&&(G.innerHTML=_e),Me=n(e),u(R.$$.fragment,e),me=n(e),$=o(e,"P",{"data-svelte-h":!0}),p($)!=="svelte-1s0lwnu"&&($.innerHTML=ze),ue=n(e),S=o(e,"P",{"data-svelte-h":!0}),p(S)!=="svelte-ei5i09"&&(S.innerHTML=Ee),ye=n(e),u(W.$$.fragment,e),de=n(e),Z=o(e,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-12vtskb"&&(Z.textContent=Ne),Je=n(e),Q=o(e,"P",{"data-svelte-h":!0}),p(Q)!=="svelte-10rnnv8"&&(Q.innerHTML=Le),Te=n(e),u(H.$$.fragment,e),Ue=n(e),u(x.$$.fragment,e),he=n(e),Y=o(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-1aeopif"&&(Y.innerHTML=Ve),we=n(e),F=o(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-x61pm7"&&(F.innerHTML=qe),be=n(e),u(_.$$.fragment,e),ge=n(e),z=o(e,"P",{"data-svelte-h":!0}),p(z)!=="svelte-1q0yg9w"&&(z.innerHTML=Xe),je=n(e),u(E.$$.fragment,e),fe=n(e),M=o(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),Re(M).forEach(t),Ce=n(e),N=o(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-13vtih2"&&(N.innerHTML=De),Ie=n(e),L=o(e,"P",{"data-svelte-h":!0}),p(L)!=="svelte-16h4z1t"&&(L.innerHTML=Ke),ke=n(e),V=o(e,"P",{"data-svelte-h":!0}),p(V)!=="svelte-f431zo"&&(V.textContent=Pe),ve=n(e),u(q.$$.fragment,e),Be=n(e),A=o(e,"P",{}),Re(A).forEach(t),this.h()},h(){c(U,"name","hf:doc:metadata"),c(U,"content",Ml),c(h,"class","flex justify-center"),Oe(r.src,Fe="https://course-demos-Rick-and-Morty-QA.hf.space")||c(r,"src",Fe),c(r,"frameborder","0"),c(r,"height","800"),c(r,"title","Gradio app"),c(r,"class","container p-0 flex-grow space-iframe"),c(r,"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"),c(r,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"),Oe(M.src,Ae="https://course-demos-Sketch-Recognition.hf.space")||c(M,"src",Ae),c(M,"frameborder","0"),c(M,"height","650"),c(M,"title","Gradio app"),c(M,"class","container p-0 flex-grow space-iframe"),c(M,"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"),c(M,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads")},m(e,l){il(document.head,U),s(e,K,l),s(e,X,l),s(e,P,l),y(w,e,l),s(e,O,l),y(b,e,l),s(e,ee,l),s(e,g,l),s(e,le,l),s(e,j,l),s(e,te,l),y(f,e,l),s(e,se,l),s(e,h,l),s(e,ae,l),s(e,C,l),s(e,ne,l),s(e,I,l),s(e,ie,l),y(k,e,l),s(e,oe,l),s(e,v,l),s(e,pe,l),s(e,r,l),s(e,ce,l),y(B,e,l),s(e,re,l),s(e,G,l),s(e,Me,l),y(R,e,l),s(e,me,l),s(e,$,l),s(e,ue,l),s(e,S,l),s(e,ye,l),y(W,e,l),s(e,de,l),s(e,Z,l),s(e,Je,l),s(e,Q,l),s(e,Te,l),y(H,e,l),s(e,Ue,l),y(x,e,l),s(e,he,l),s(e,Y,l),s(e,we,l),s(e,F,l),s(e,be,l),y(_,e,l),s(e,ge,l),s(e,z,l),s(e,je,l),y(E,e,l),s(e,fe,l),s(e,M,l),s(e,Ce,l),s(e,N,l),s(e,Ie,l),s(e,L,l),s(e,ke,l),s(e,V,l),s(e,ve,l),y(q,e,l),s(e,Be,l),s(e,A,l),Ge=!0},p:ll,i(e){Ge||(d(w.$$.fragment,e),d(b.$$.fragment,e),d(f.$$.fragment,e),d(k.$$.fragment,e),d(B.$$.fragment,e),d(R.$$.fragment,e),d(W.$$.fragment,e),d(H.$$.fragment,e),d(x.$$.fragment,e),d(_.$$.fragment,e),d(E.$$.fragment,e),d(q.$$.fragment,e),Ge=!0)},o(e){J(w.$$.fragment,e),J(b.$$.fragment,e),J(f.$$.fragment,e),J(k.$$.fragment,e),J(B.$$.fragment,e),J(R.$$.fragment,e),J(W.$$.fragment,e),J(H.$$.fragment,e),J(x.$$.fragment,e),J(_.$$.fragment,e),J(E.$$.fragment,e),J(q.$$.fragment,e),Ge=!1},d(e){e&&(t(K),t(X),t(P),t(O),t(ee),t(g),t(le),t(j),t(te),t(se),t(h),t(ae),t(C),t(ne),t(I),t(ie),t(oe),t(v),t(pe),t(r),t(ce),t(re),t(G),t(Me),t(me),t($),t(ue),t(S),t(ye),t(de),t(Z),t(Je),t(Q),t(Te),t(Ue),t(he),t(Y),t(we),t(F),t(be),t(ge),t(z),t(je),t(fe),t(M),t(Ce),t(N),t(Ie),t(L),t(ke),t(V),t(ve),t(Be),t(A)),t(U),T(w,e),T(b,e),T(f,e),T(k,e),T(B,e),T(R,e),T(W,e),T(H,e),T(x,e),T(_,e),T(E,e),T(q,e)}}}const Ml='{"title":"与他人分享演示","local":"与他人分享演示","sections":[{"title":"打磨你的 Gradio 演示:","local":"打磨你的 Gradio 演示:","sections":[],"depth":3},{"title":"使用临时链接分享您的演示","local":"使用临时链接分享您的演示","sections":[],"depth":3},{"title":"在 Hugging Face Spaces 上托管您的演示","local":"在 Hugging Face Spaces 上托管您的演示","sections":[],"depth":3},{"title":"✏️ 让我们应用它!","local":"✏️ 让我们应用它!","sections":[],"depth":2}],"depth":1}';function ml(Se){return tl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hl extends sl{constructor(U){super(),al(this,U,ml,rl,el,{})}}export{hl as component};
