import{s as tl,a as ll,n as sl,o as al}from"../chunks/scheduler.cc52f4b9.js";import{S as nl,i as il,e as i,s as a,c as m,h as ol,a as o,d as t,b as n,f as Se,g as u,j as p,k as c,l as pl,m as s,n as y,t as d,o as J,p as T}from"../chunks/index.9480bb2b.js";import{C as cl,H as K,E as rl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.52103c90.js";import{Y as Ml}from"../chunks/Youtube.7b12d9e8.js";import{C as We}from"../chunks/CodeBlock.c5404643.js";import{D as ml}from"../chunks/DocNotebookDropdown.ea74f0e0.js";function ul(Ze){let U,P,A,O,w,ee,b,le,g,te,j,xe=`現在您已經構建了一個演示，您可能希望與其他人分享它。 梯度演示
可以通過兩種方式共享：使用 <strong><em>temporary share link</em></strong> 或 <strong><em>permanent hosting on Spaces</em></strong>。`,se,f,Qe="我們將很快介紹這兩種方法。 但在分享演示之前，您可能需要完善它 💅.",ae,C,ne,h,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"/>',ie,I,Ye="為了給你的演示添加額外的內容，<code>Interface</code> 類支持一些可選參數：",oe,k,ze=`<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>`,pe,B,ce,v,Fe="使用上面的選項，我們最終得到了一個更完整的界面。 試試下面的界面：",re,r,_e,Me,G,me,$,Le=`現在我們已經有了機器學習模型的工作演示，讓我們學習如何輕鬆共享指向我們界面的鏈接。
通過在 <code>launch()</code> 方法中設置 <code>share=True</code> 可以輕鬆地公開共享接口：`,ue,R,ye,S,Ee="這會生成一個公開的、可共享的鏈接，您可以將其發送給任何人！ 當您發送此鏈接時，另一方的用戶可以在瀏覽器中試用該模型長達 72 小時。 因為處理發生在您的設備上（只要您的設備保持開啟！），您不必擔心打包任何依賴項。 如果您使用 Google Colab 筆記本工作，則始終會自動創建共享鏈接。 它通常看起來像這樣：<strong>XXXXX.gradio.app</strong>。 雖然鏈接是通過 Gradio 鏈接提供的，但我們只是您本地服務器的代理，不會存儲通過接口發送的任何數據。",de,W,Ne="但是請記住，這些鏈接是可公開訪問的，這意味著任何人都可以使用您的模型進行預測！ 因此，請確保不要通過您編寫的函數公開任何敏感信息，或允許在您的設備上發生任何關鍵更改。 如果設置 <code>share=False</code>（默認值），則僅創建本地鏈接。",Je,Z,Te,x,Ve="可以傳遞給同事的共享鏈接很酷，但是如何永久託管您的演示並讓它存在於互聯網上自己的“空間”中？",Ue,Q,qe=`Hugging Face Spaces 提供了在互聯網上永久託管 Gradio 模型的基礎設施，<strong>免費</strong>！ Spaces 允許您創建並推送到（公共或私人）存儲庫，
你的 Gradio 在哪裡
接口代碼將存在於 <code>app.py</code> 文件中。 <a href="https://huggingface.co/blog/gradio-spaces" rel="nofollow">閱讀分步教程</a> 開始使用，或觀看下面的示例視頻。`,he,H,we,Y,be,z,Xe='使用到目前為止我們在各節中學到的知識，讓我們創建我們在<a href="/course/chapter9/1">本章第一節</a>中看到的草圖識別演示。 讓我們為我們的界面添加一些自定義並設置 <code>share=True</code> 以創建一個我們可以傳遞的公共鏈接。',ge,F,Ae='我們可以從 <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>函數：',je,_,fe,L,De="現在我們有了一個<code>predict()</code>函數。 下一步是定義並啟動我們的漸變界面：",Ce,E,Ie,M,Ke,ke,N,Pe=`注意 <code>Interface</code> 中的 <code>live=True</code> 參數，這意味著草圖演示使
每次有人在畫板上畫畫時的預測（沒有提交按鈕！）。`,Be,V,Oe=`此外，我們還在 <code>launch()</code> 方法中設置了 <code>share=True</code> 參數。
這將創建一個公共鏈接，您可以發送給任何人！ 當您發送此鏈接時，對方的用戶可以嘗試草圖識別模型。 重申一下，您還可以在 Hugging Face Spaces 上託管模型，這就是我們能夠嵌入上面的演示的方式。`,ve,q,el="接下來，我們將介紹 Gradio 可用於 Hugging Face 生態系統的其他方式！",Ge,X,$e,D,Re;return w=new cl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),b=new K({props:{title:"與他人分享演示",local:"與他人分享演示",headingTag:"h1"}}),g=new ml({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"}]}}),C=new K({props:{title:"打磨你的 Gradio 演示:",local:"打磨你的-gradio-演示",headingTag:"h3"}}),B=new We({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}}),G=new K({props:{title:"使用臨時鏈接分享您的演示",local:"使用臨時鏈接分享您的演示",headingTag:"h3"}}),R=new We({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}}),Z=new K({props:{title:"在 Hugging Face Spaces 上託管您的演示",local:"在-hugging-face-spaces-上託管您的演示",headingTag:"h3"}}),H=new Ml({props:{id:"LS9Y2wDVI0k"}}),Y=new K({props:{title:"✏️ 讓我們應用它!",local:"-讓我們應用它",headingTag:"h2"}}),_=new We({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}}),E=new We({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 rl({props:{source:"https://github.com/huggingface/course/blob/main/chapters/zh-TW/chapter9/4.mdx"}}),{c(){U=i("meta"),P=a(),A=i("p"),O=a(),m(w.$$.fragment),ee=a(),m(b.$$.fragment),le=a(),m(g.$$.fragment),te=a(),j=i("p"),j.innerHTML=xe,se=a(),f=i("p"),f.textContent=Qe,ae=a(),m(C.$$.fragment),ne=a(),h=i("div"),h.innerHTML=He,ie=a(),I=i("p"),I.innerHTML=Ye,oe=a(),k=i("ul"),k.innerHTML=ze,pe=a(),m(B.$$.fragment),ce=a(),v=i("p"),v.textContent=Fe,re=a(),r=i("iframe"),Me=a(),m(G.$$.fragment),me=a(),$=i("p"),$.innerHTML=Le,ue=a(),m(R.$$.fragment),ye=a(),S=i("p"),S.innerHTML=Ee,de=a(),W=i("p"),W.innerHTML=Ne,Je=a(),m(Z.$$.fragment),Te=a(),x=i("p"),x.textContent=Ve,Ue=a(),Q=i("p"),Q.innerHTML=qe,he=a(),m(H.$$.fragment),we=a(),m(Y.$$.fragment),be=a(),z=i("p"),z.innerHTML=Xe,ge=a(),F=i("p"),F.innerHTML=Ae,je=a(),m(_.$$.fragment),fe=a(),L=i("p"),L.innerHTML=De,Ce=a(),m(E.$$.fragment),Ie=a(),M=i("iframe"),ke=a(),N=i("p"),N.innerHTML=Pe,Be=a(),V=i("p"),V.innerHTML=Oe,ve=a(),q=i("p"),q.textContent=el,Ge=a(),m(X.$$.fragment),$e=a(),D=i("p"),this.h()},l(e){const l=ol("svelte-u9bgzb",document.head);U=o(l,"META",{name:!0,content:!0}),l.forEach(t),P=n(e),A=o(e,"P",{}),Se(A).forEach(t),O=n(e),u(w.$$.fragment,e),ee=n(e),u(b.$$.fragment,e),le=n(e),u(g.$$.fragment,e),te=n(e),j=o(e,"P",{"data-svelte-h":!0}),p(j)!=="svelte-1qpx3vy"&&(j.innerHTML=xe),se=n(e),f=o(e,"P",{"data-svelte-h":!0}),p(f)!=="svelte-1i80r9v"&&(f.textContent=Qe),ae=n(e),u(C.$$.fragment,e),ne=n(e),h=o(e,"DIV",{class:!0,"data-svelte-h":!0}),p(h)!=="svelte-nclpfp"&&(h.innerHTML=He),ie=n(e),I=o(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-2u4qs3"&&(I.innerHTML=Ye),oe=n(e),k=o(e,"UL",{"data-svelte-h":!0}),p(k)!=="svelte-t1tq40"&&(k.innerHTML=ze),pe=n(e),u(B.$$.fragment,e),ce=n(e),v=o(e,"P",{"data-svelte-h":!0}),p(v)!=="svelte-jxhkc1"&&(v.textContent=Fe),re=n(e),r=o(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),Se(r).forEach(t),Me=n(e),u(G.$$.fragment,e),me=n(e),$=o(e,"P",{"data-svelte-h":!0}),p($)!=="svelte-rsu6zg"&&($.innerHTML=Le),ue=n(e),u(R.$$.fragment,e),ye=n(e),S=o(e,"P",{"data-svelte-h":!0}),p(S)!=="svelte-1js6txb"&&(S.innerHTML=Ee),de=n(e),W=o(e,"P",{"data-svelte-h":!0}),p(W)!=="svelte-12u4g0g"&&(W.innerHTML=Ne),Je=n(e),u(Z.$$.fragment,e),Te=n(e),x=o(e,"P",{"data-svelte-h":!0}),p(x)!=="svelte-sutkc9"&&(x.textContent=Ve),Ue=n(e),Q=o(e,"P",{"data-svelte-h":!0}),p(Q)!=="svelte-1likzwc"&&(Q.innerHTML=qe),he=n(e),u(H.$$.fragment,e),we=n(e),u(Y.$$.fragment,e),be=n(e),z=o(e,"P",{"data-svelte-h":!0}),p(z)!=="svelte-1d1dxso"&&(z.innerHTML=Xe),ge=n(e),F=o(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-1wy2dzw"&&(F.innerHTML=Ae),je=n(e),u(_.$$.fragment,e),fe=n(e),L=o(e,"P",{"data-svelte-h":!0}),p(L)!=="svelte-1nc2ldo"&&(L.innerHTML=De),Ce=n(e),u(E.$$.fragment,e),Ie=n(e),M=o(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),Se(M).forEach(t),ke=n(e),N=o(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-1dp4vj3"&&(N.innerHTML=Pe),Be=n(e),V=o(e,"P",{"data-svelte-h":!0}),p(V)!=="svelte-128yuu9"&&(V.innerHTML=Oe),ve=n(e),q=o(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-10qh459"&&(q.textContent=el),Ge=n(e),u(X.$$.fragment,e),$e=n(e),D=o(e,"P",{}),Se(D).forEach(t),this.h()},h(){c(U,"name","hf:doc:metadata"),c(U,"content",yl),c(h,"class","flex justify-center"),ll(r.src,_e="https://course-demos-Rick-and-Morty-QA.hf.space")||c(r,"src",_e),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"),ll(M.src,Ke="https://course-demos-Sketch-Recognition.hf.space")||c(M,"src",Ke),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){pl(document.head,U),s(e,P,l),s(e,A,l),s(e,O,l),y(w,e,l),s(e,ee,l),y(b,e,l),s(e,le,l),y(g,e,l),s(e,te,l),s(e,j,l),s(e,se,l),s(e,f,l),s(e,ae,l),y(C,e,l),s(e,ne,l),s(e,h,l),s(e,ie,l),s(e,I,l),s(e,oe,l),s(e,k,l),s(e,pe,l),y(B,e,l),s(e,ce,l),s(e,v,l),s(e,re,l),s(e,r,l),s(e,Me,l),y(G,e,l),s(e,me,l),s(e,$,l),s(e,ue,l),y(R,e,l),s(e,ye,l),s(e,S,l),s(e,de,l),s(e,W,l),s(e,Je,l),y(Z,e,l),s(e,Te,l),s(e,x,l),s(e,Ue,l),s(e,Q,l),s(e,he,l),y(H,e,l),s(e,we,l),y(Y,e,l),s(e,be,l),s(e,z,l),s(e,ge,l),s(e,F,l),s(e,je,l),y(_,e,l),s(e,fe,l),s(e,L,l),s(e,Ce,l),y(E,e,l),s(e,Ie,l),s(e,M,l),s(e,ke,l),s(e,N,l),s(e,Be,l),s(e,V,l),s(e,ve,l),s(e,q,l),s(e,Ge,l),y(X,e,l),s(e,$e,l),s(e,D,l),Re=!0},p:sl,i(e){Re||(d(w.$$.fragment,e),d(b.$$.fragment,e),d(g.$$.fragment,e),d(C.$$.fragment,e),d(B.$$.fragment,e),d(G.$$.fragment,e),d(R.$$.fragment,e),d(Z.$$.fragment,e),d(H.$$.fragment,e),d(Y.$$.fragment,e),d(_.$$.fragment,e),d(E.$$.fragment,e),d(X.$$.fragment,e),Re=!0)},o(e){J(w.$$.fragment,e),J(b.$$.fragment,e),J(g.$$.fragment,e),J(C.$$.fragment,e),J(B.$$.fragment,e),J(G.$$.fragment,e),J(R.$$.fragment,e),J(Z.$$.fragment,e),J(H.$$.fragment,e),J(Y.$$.fragment,e),J(_.$$.fragment,e),J(E.$$.fragment,e),J(X.$$.fragment,e),Re=!1},d(e){e&&(t(P),t(A),t(O),t(ee),t(le),t(te),t(j),t(se),t(f),t(ae),t(ne),t(h),t(ie),t(I),t(oe),t(k),t(pe),t(ce),t(v),t(re),t(r),t(Me),t(me),t($),t(ue),t(ye),t(S),t(de),t(W),t(Je),t(Te),t(x),t(Ue),t(Q),t(he),t(we),t(be),t(z),t(ge),t(F),t(je),t(fe),t(L),t(Ce),t(Ie),t(M),t(ke),t(N),t(Be),t(V),t(ve),t(q),t(Ge),t($e),t(D)),t(U),T(w,e),T(b,e),T(g,e),T(C,e),T(B,e),T(G,e),T(R,e),T(Z,e),T(H,e),T(Y,e),T(_,e),T(E,e),T(X,e)}}}const yl='{"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 dl(Ze){return al(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class gl extends nl{constructor(U){super(),il(this,U,dl,ul,tl,{})}}export{gl as component};
