import{S as op,i as sp,s as ap,e as a,k as d,w as N,t as o,M as rp,c as r,d as l,m as u,a as i,x as H,h as s,b as c,N as dl,G as t,g as n,y as z,q as U,o as W,B as J,v as ip}from"../../chunks/vendor-hf-doc-builder.js";import{T as pp}from"../../chunks/Tip-hf-doc-builder.js";import{I as Er}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as ul}from"../../chunks/CodeBlock-hf-doc-builder.js";import{D as np}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function cp(fl){let _;return{c(){_=o("\u{1F64B}\u5982\u679C\u4F60\u4E0D\u719F\u6089 Python \u4E2D\u7684 `with` \u8BED\u53E5, \u6211\u4EEC\u5EFA\u8BAE\u4F60\u67E5\u770B\u6765\u81EA Real Python \u7684\u6781\u597D\u7684[\u6559\u7A0B](https://realpython.com/python-with-statement/)\u3002\u770B\u5B8C\u540E\u56DE\u5230\u8FD9\u91CC \u{1F917}")},l(A){_=s(A,"\u{1F64B}\u5982\u679C\u4F60\u4E0D\u719F\u6089 Python \u4E2D\u7684 `with` \u8BED\u53E5, \u6211\u4EEC\u5EFA\u8BAE\u4F60\u67E5\u770B\u6765\u81EA Real Python \u7684\u6781\u597D\u7684[\u6559\u7A0B](https://realpython.com/python-with-statement/)\u3002\u770B\u5B8C\u540E\u56DE\u5230\u8FD9\u91CC \u{1F917}")},m(A,O){n(A,_,O)},d(A){A&&l(_)}}}function dp(fl){let _,A,O,Y,Qe,he,uo,Ve,fo,ml,_e,hl,j,mo,Xe,ho,_o,Ye,xo,bo,Ze,wo,go,_l,B,Eo,et,vo,yo,tt,ko,jo,xl,Z,lt,xe,$o,ot,Co,To,Po,st,K,qo,at,Do,Oo,rt,Io,Ao,bl,be,Bo,wl,$,Fo,it,So,Lo,pt,Ro,Go,nt,Mo,No,gl,C,ct,Ho,zo,dt,Uo,Wo,ut,Jo,Ko,ft,Qo,El,Be,Vo,vl,Q,ee,mt,we,Xo,ht,Yo,yl,Fe,Zo,kl,ge,jl,w,vr,$l,Se,es,Cl,T,te,_t,ts,ls,le,os,ss,xt,Ee,as,bt,rs,is,ps,V,g,ns,wt,cs,ds,gt,us,fs,Et,ms,hs,vt,_s,xs,bs,f,ws,yt,gs,Es,kt,vs,ys,jt,ks,js,$t,$s,Cs,Ct,Ts,Ps,Tt,qs,Ds,Pt,Os,Is,As,ve,Bs,ye,Fs,Ss,Ls,qt,I,Rs,Dt,Gs,Ms,Ot,Ns,Hs,It,zs,Us,Tl,ke,Ws,Pl,x,Js,At,Ks,Qs,Bt,Vs,Xs,Ft,Ys,Zs,St,ea,ta,ql,P,la,Lt,oa,sa,Rt,aa,ra,je,ia,pa,Dl,q,na,Gt,ca,da,Mt,ua,fa,Nt,ma,ha,Ol,oe,_a,Ht,xa,ba,Il,$e,Al,E,yr,Bl,se,wa,zt,ga,Ea,Fl,Ce,va,Sl,ae,ya,Ut,ka,ja,Ll,b,$a,Wt,Ca,Ta,Jt,Pa,qa,Kt,Da,Oa,Qt,Ia,Aa,Rl,F,Ba,Vt,Fa,Sa,Xt,La,Ra,Gl,S,Le,Yt,Ga,Ma,Na,Re,Zt,Ha,za,Ua,Ge,el,Wa,Ja,Ml,Me,Ka,Nl,Te,Hl,v,kr,zl,X,re,tl,Pe,Qa,ll,Va,Ul,L,Xa,ol,Ya,Za,sl,er,tr,Wl,qe,Jl,y,jr,Kl,De,lr,Ql,ie,or,al,sr,ar,Vl,Ne,rr,Xl,Oe,Yl,k,$r,Zl,m,ir,rl,pr,nr,il,cr,dr,pl,ur,fr,nl,mr,hr,Ie,_r,xr,eo;return he=new Er({}),_e=new np({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/section7.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/chapter9/section7.ipynb"}]}}),we=new Er({}),ge=new ul({props:{code:`import gradio as gr


def flip_text(x):
    return x[::-1]


demo = gr.Blocks()

with demo:
    gr.Markdown(
        """
    # Flip Text!
    Start typing below to see the output.
    """
    )
    input = gr.Textbox(placeholder="Flip this text")
    output = gr.Textbox()

    input.change(fn=flip_text, inputs=input, outputs=output)

demo.launch()`,highlighted:`<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr


<span class="hljs-keyword">def</span> <span class="hljs-title function_">flip_text</span>(<span class="hljs-params">x</span>):
    <span class="hljs-keyword">return</span> x[::-<span class="hljs-number">1</span>]


demo = gr.Blocks()

<span class="hljs-keyword">with</span> demo:
    gr.Markdown(
        <span class="hljs-string">&quot;&quot;&quot;
    # Flip Text!
    Start typing below to see the output.
    &quot;&quot;&quot;</span>
    )
    <span class="hljs-built_in">input</span> = gr.Textbox(placeholder=<span class="hljs-string">&quot;Flip this text&quot;</span>)
    output = gr.Textbox()

    <span class="hljs-built_in">input</span>.change(fn=flip_text, inputs=<span class="hljs-built_in">input</span>, outputs=output)

demo.launch()`}}),le=new pp({props:{$$slots:{default:[cp]},$$scope:{ctx:fl}}}),$e=new ul({props:{code:`import numpy as np
import gradio as gr

demo = gr.Blocks()


def flip_text(x):
    return x[::-1]


def flip_image(x):
    return np.fliplr(x)


with demo:
    gr.Markdown("Flip text or image files using this demo.")
    with gr.Tabs():
        with gr.TabItem("Flip Text"):
            with gr.Row():
                text_input = gr.Textbox()
                text_output = gr.Textbox()
            text_button = gr.Button("Flip")
        with gr.TabItem("Flip Image"):
            with gr.Row():
                image_input = gr.Image()
                image_output = gr.Image()
            image_button = gr.Button("Flip")

    text_button.click(flip_text, inputs=text_input, outputs=text_output)
    image_button.click(flip_image, inputs=image_input, outputs=image_output)

demo.launch()`,highlighted:`<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr

demo = gr.Blocks()


<span class="hljs-keyword">def</span> <span class="hljs-title function_">flip_text</span>(<span class="hljs-params">x</span>):
    <span class="hljs-keyword">return</span> x[::-<span class="hljs-number">1</span>]


<span class="hljs-keyword">def</span> <span class="hljs-title function_">flip_image</span>(<span class="hljs-params">x</span>):
    <span class="hljs-keyword">return</span> np.fliplr(x)


<span class="hljs-keyword">with</span> demo:
    gr.Markdown(<span class="hljs-string">&quot;Flip text or image files using this demo.&quot;</span>)
    <span class="hljs-keyword">with</span> gr.Tabs():
        <span class="hljs-keyword">with</span> gr.TabItem(<span class="hljs-string">&quot;Flip Text&quot;</span>):
            <span class="hljs-keyword">with</span> gr.Row():
                text_input = gr.Textbox()
                text_output = gr.Textbox()
            text_button = gr.Button(<span class="hljs-string">&quot;Flip&quot;</span>)
        <span class="hljs-keyword">with</span> gr.TabItem(<span class="hljs-string">&quot;Flip Image&quot;</span>):
            <span class="hljs-keyword">with</span> gr.Row():
                image_input = gr.Image()
                image_output = gr.Image()
            image_button = gr.Button(<span class="hljs-string">&quot;Flip&quot;</span>)

    text_button.click(flip_text, inputs=text_input, outputs=text_output)
    image_button.click(flip_image, inputs=image_input, outputs=image_output)

demo.launch()`}}),Te=new ul({props:{code:`import gradio as gr

api = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")


def complete_with_gpt(text):
    # Use the last 50 characters of the text as context
    return text[:-50] + api(text[-50:])


with gr.Blocks() as demo:
    textbox = gr.Textbox(placeholder="Type here and press enter...", lines=4)
    btn = gr.Button("Generate")

    btn.click(complete_with_gpt, textbox, textbox)

demo.launch()`,highlighted:`<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr

api = gr.Interface.load(<span class="hljs-string">&quot;huggingface/EleutherAI/gpt-j-6B&quot;</span>)


<span class="hljs-keyword">def</span> <span class="hljs-title function_">complete_with_gpt</span>(<span class="hljs-params">text</span>):
    <span class="hljs-comment"># Use the last 50 characters of the text as context</span>
    <span class="hljs-keyword">return</span> text[:-<span class="hljs-number">50</span>] + api(text[-<span class="hljs-number">50</span>:])


<span class="hljs-keyword">with</span> gr.Blocks() <span class="hljs-keyword">as</span> demo:
    textbox = gr.Textbox(placeholder=<span class="hljs-string">&quot;Type here and press enter...&quot;</span>, lines=<span class="hljs-number">4</span>)
    btn = gr.Button(<span class="hljs-string">&quot;Generate&quot;</span>)

    btn.click(complete_with_gpt, textbox, textbox)

demo.launch()`}}),Pe=new Er({}),qe=new ul({props:{code:`from transformers import pipeline

import gradio as gr

asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
classifier = pipeline("text-classification")


def speech_to_text(speech):
    text = asr(speech)["text"]
    return text


def text_to_sentiment(text):
    return classifier(text)[0]["label"]


demo = gr.Blocks()

with demo:
    audio_file = gr.Audio(type="filepath")
    text = gr.Textbox()
    label = gr.Label()

    b1 = gr.Button("Recognize Speech")
    b2 = gr.Button("Classify Sentiment")

    b1.click(speech_to_text, inputs=audio_file, outputs=text)
    b2.click(text_to_sentiment, inputs=text, outputs=label)

demo.launch()`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr

asr = pipeline(<span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>, <span class="hljs-string">&quot;facebook/wav2vec2-base-960h&quot;</span>)
classifier = pipeline(<span class="hljs-string">&quot;text-classification&quot;</span>)


<span class="hljs-keyword">def</span> <span class="hljs-title function_">speech_to_text</span>(<span class="hljs-params">speech</span>):
    text = asr(speech)[<span class="hljs-string">&quot;text&quot;</span>]
    <span class="hljs-keyword">return</span> text


<span class="hljs-keyword">def</span> <span class="hljs-title function_">text_to_sentiment</span>(<span class="hljs-params">text</span>):
    <span class="hljs-keyword">return</span> classifier(text)[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;label&quot;</span>]


demo = gr.Blocks()

<span class="hljs-keyword">with</span> demo:
    audio_file = gr.Audio(<span class="hljs-built_in">type</span>=<span class="hljs-string">&quot;filepath&quot;</span>)
    text = gr.Textbox()
    label = gr.Label()

    b1 = gr.Button(<span class="hljs-string">&quot;Recognize Speech&quot;</span>)
    b2 = gr.Button(<span class="hljs-string">&quot;Classify Sentiment&quot;</span>)

    b1.click(speech_to_text, inputs=audio_file, outputs=text)
    b2.click(text_to_sentiment, inputs=text, outputs=label)

demo.launch()`}}),Oe=new ul({props:{code:`import gradio as gr


def change_textbox(choice):
    if choice == "short":
        return gr.Textbox.update(lines=2, visible=True)
    elif choice == "long":
        return gr.Textbox.update(lines=8, visible=True)
    else:
        return gr.Textbox.update(visible=False)


with gr.Blocks() as block:
    radio = gr.Radio(
        ["short", "long", "none"], label="What kind of essay would you like to write?"
    )
    text = gr.Textbox(lines=2, interactive=True)

    radio.change(fn=change_textbox, inputs=radio, outputs=text)
    block.launch()`,highlighted:`<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr


<span class="hljs-keyword">def</span> <span class="hljs-title function_">change_textbox</span>(<span class="hljs-params">choice</span>):
    <span class="hljs-keyword">if</span> choice == <span class="hljs-string">&quot;short&quot;</span>:
        <span class="hljs-keyword">return</span> gr.Textbox.update(lines=<span class="hljs-number">2</span>, visible=<span class="hljs-literal">True</span>)
    <span class="hljs-keyword">elif</span> choice == <span class="hljs-string">&quot;long&quot;</span>:
        <span class="hljs-keyword">return</span> gr.Textbox.update(lines=<span class="hljs-number">8</span>, visible=<span class="hljs-literal">True</span>)
    <span class="hljs-keyword">else</span>:
        <span class="hljs-keyword">return</span> gr.Textbox.update(visible=<span class="hljs-literal">False</span>)


<span class="hljs-keyword">with</span> gr.Blocks() <span class="hljs-keyword">as</span> block:
    radio = gr.Radio(
        [<span class="hljs-string">&quot;short&quot;</span>, <span class="hljs-string">&quot;long&quot;</span>, <span class="hljs-string">&quot;none&quot;</span>], label=<span class="hljs-string">&quot;What kind of essay would you like to write?&quot;</span>
    )
    text = gr.Textbox(lines=<span class="hljs-number">2</span>, interactive=<span class="hljs-literal">True</span>)

    radio.change(fn=change_textbox, inputs=radio, outputs=text)
    block.launch()`}}),{c(){_=a("meta"),A=d(),O=a("h1"),Y=a("a"),Qe=a("span"),N(he.$$.fragment),uo=d(),Ve=a("span"),fo=o("Gradio \u5757\u7B80\u4ECB"),ml=d(),N(_e.$$.fragment),hl=d(),j=a("p"),mo=o("\u5728\u524D\u9762\u7684\u90E8\u5206\u4E2D, \u6211\u4EEC\u5DF2\u7ECF\u4F7F\u7528 "),Xe=a("code"),ho=o("Interface"),_o=o(" \u7C7B\u63A2\u7D22\u5E76\u521B\u5EFA\u4E86\u6F14\u793A\u3002\u5728\u672C\u8282\u4E2D, \u6211\u4EEC\u5C06\u4ECB\u7ECD\u6211\u4EEC "),Ye=a("strong"),xo=o("\u65B0\u5F00\u53D1"),bo=o("\u7684\u79F0\u4E3A"),Ze=a("code"),wo=o("gradio.Blocks"),go=o("\u4F4E\u7EA7API\u3002"),_l=d(),B=a("p"),Eo=o("\u73B0\u5728, "),et=a("code"),vo=o("\u63A5\u53E3"),yo=o("\u548C"),tt=a("code"),ko=o("\u5757"),jo=o("\u4E4B\u95F4\u6709\u4EC0\u4E48\u533A\u522B?"),xl=d(),Z=a("ul"),lt=a("li"),xe=a("p"),$o=o("\u26A1 "),ot=a("code"),Co=o("\u63A5\u53E3"),To=o(": \u4E00\u4E2A\u9AD8\u7EA7 API, \u8BA9\u4F60\u53EA\u9700\u63D0\u4F9B\u8F93\u5165\u548C\u8F93\u51FA\u5217\u8868\u5373\u53EF\u521B\u5EFA\u5B8C\u6574\u7684\u673A\u5668\u5B66\u4E60\u6F14\u793A\u3002"),Po=d(),st=a("li"),K=a("p"),qo=o("\u{1F9F1} "),at=a("code"),Do=o("\u5757"),Oo=o(": :\u4E00\u4E2A\u4F4E\u7EA7\u7684 API, \u5B83\u5141\u8BB8\u4F60\u5B8C\u5168\u63A7\u5236\u4F60\u7684\u5E94\u7528\u7A0B\u5E8F\u7684\u6570\u636E\u6D41\u548C\u5E03\u5C40\u3002\u60A8\u53EF\u4EE5\u4F7F\u7528"),rt=a("code"),Io=o("\u5757"),Ao=o("(\u5982 \u201C\u6784\u5EFA\u5757\u201D)\u6784\u5EFA\u975E\u5E38\u590D\u6742\u7684\u591A\u6B65\u9AA4\u5E94\u7528\u7A0B\u5E8F\u3002"),bl=d(),be=a("h3"),Bo=o("\u4E3A\u4EC0\u4E48\u8981\u5757 \u{1F9F1}?"),wl=d(),$=a("p"),Fo=o("\u6B63\u5982\u6211\u4EEC\u5728\u524D\u51E0\u8282\u4E2D\u770B\u5230\u7684, "),it=a("code"),So=o("Interface"),Lo=o(" \u7C7B\u5141\u8BB8\u4F60\u4F7F\u7528\u51E0\u884C\u4EE3\u7801\u8F7B\u677E\u521B\u5EFA\u6210\u719F\u7684\u673A\u5668\u5B66\u4E60demo\u3002"),pt=a("code"),Ro=o("Interface"),Go=o(" API \u975E\u5E38\u6613\u4E8E\u4F7F\u7528, \u4F46\u7F3A\u4E4F "),nt=a("code"),Mo=o("Blocks"),No=o(" API \u63D0\u4F9B\u7684\u7075\u6D3B\u6027\u3002\u4F8B\u5982, \u4F60\u53EF\u80FD\u60F3\u8981:"),gl=d(),C=a("ul"),ct=a("li"),Ho=o("\u5C06\u76F8\u5173\u6F14\u793A\u7EC4\u5408\u4E3A\u4E00\u4E2Aweb\u5E94\u7528\u7A0B\u5E8F\u4E2D\u7684\u591A\u4E2A\u9009\u9879\u5361"),zo=d(),dt=a("li"),Uo=o("\u66F4\u6539demo\u7684\u5E03\u5C40, \u4F8B\u5982\u6307\u5B9A\u8F93\u5165\u548C\u8F93\u51FA\u7684\u4F4D\u7F6E"),Wo=d(),ut=a("li"),Jo=o("\u5177\u6709\u591A\u6B65\u9AA4\u63A5\u53E3, \u5176\u4E2D\u4E00\u4E2A\u6A21\u578B\u7684\u8F93\u51FA\u6210\u4E3A\u4E0B\u4E00\u4E2A\u6A21\u578B\u7684\u8F93\u5165, \u6216\u8005\u901A\u5E38\u5177\u6709\u66F4\u7075\u6D3B\u7684\u6570\u636E\u6D41"),Ko=d(),ft=a("li"),Qo=o("\u6839\u636E\u7528\u6237\u8F93\u5165\u66F4\u6539\u7EC4\u4EF6\u7684\u5C5E\u6027 (\u4F8B\u5982, \u4E0B\u62C9\u5217\u8868\u4E2D\u7684\u9009\u9879) \u6216\u5176\u53EF\u89C1\u6027"),El=d(),Be=a("p"),Vo=o("\u6211\u4EEC\u5C06\u5728\u4E0B\u9762\u63A2\u8BA8\u6240\u6709\u8FD9\u4E9B\u6982\u5FF5\u3002"),vl=d(),Q=a("h3"),ee=a("a"),mt=a("span"),N(we.$$.fragment),Xo=d(),ht=a("span"),Yo=o("\u4F7F\u7528\u5757\u521B\u5EFA\u7B80\u5355demo"),yl=d(),Fe=a("p"),Zo=o("\u5B89\u88C5 Gradio \u540E, \u5C06\u4EE5\u4E0B\u4EE3\u7801\u4F5C\u4E3A Python \u811A\u672C\u3001Jupyter \u7B14\u8BB0\u672C\u6216 Colab \u7B14\u8BB0\u672C\u8FD0\u884C\u3002"),kl=d(),N(ge.$$.fragment),jl=d(),w=a("iframe"),$l=d(),Se=a("p"),es=o("\u4E0A\u8FF0\u7B80\u5355\u793A\u4F8B\u4ECB\u7ECD\u4E86\u5757\u76844\u4E2A\u57FA\u672C\u6982\u5FF5:"),Cl=d(),T=a("ol"),te=a("li"),_t=a("p"),ts=o("\u5757\u5141\u8BB8\u4F60\u5141\u8BB8\u4F60\u6784\u5EFA\u7ED3\u5408markdown\u3001HTML\u3001\u6309\u94AE\u548C\u4EA4\u4E92\u7EC4\u4EF6\u7684web\u5E94\u7528\u7A0B\u5E8F, \u53EA\u9700\u5728\u4E00\u4E2A\u5E26\u6709gradio\u7684Python\u4E2D\u5B9E\u4F8B\u5316\u5BF9\u8C61\u3002"),ls=d(),N(le.$$.fragment),os=o(`
\u5B9E\u4F8B\u5316\u7EC4\u4EF6\u7684\u987A\u5E8F\u5F88\u91CD\u8981, \u56E0\u4E3A\u6BCF\u4E2A\u5143\u7D20\u90FD\u6309\u7167\u521B\u5EFA\u7684\u987A\u5E8F\u5448\u73B0\u5230 Web \u5E94\u7528\u7A0B\u5E8F\u4E2D\u3002(\u66F4\u590D\u6742\u7684\u5E03\u5C40\u5728\u4E0B\u9762\u8BA8\u8BBA)`),ss=d(),xt=a("li"),Ee=a("p"),as=o("\u4F60\u53EF\u4EE5\u5728\u4EE3\u7801\u4E2D\u7684\u4EFB\u4F55\u4F4D\u7F6E\u5B9A\u4E49\u5E38\u89C4 Python \u51FD\u6570, \u5E76\u4F7F\u7528"),bt=a("code"),rs=o("\u5757"),is=o("\u5728\u7528\u6237\u8F93\u5165\u7684\u60C5\u51B5\u4E0B\u8FD0\u884C\u5B83\u4EEC\u3002\u5728\u6211\u4EEC\u7684\u793A\u4F8B\u4E2D, \u4EEC\u6709\u4E00\u4E2A\u201D\u7FFB\u8F6C\u201D\u8F93\u5165\u6587\u672C\u7684\u7B80\u5355\u51FD\u6570, \u4F46\u4F60\u53EF\u4EE5\u7F16\u5199\u4EFB\u4F55 Python \u51FD\u6570, \u4ECE\u7B80\u5355\u7684\u8BA1\u7B97\u5230\u5904\u7406\u673A\u5668\u5B66\u4E60\u6A21\u578B\u7684\u9884\u6D4B\u3002"),ps=d(),V=a("li"),g=a("p"),ns=o("\u4F60\u53EF\u4EE5\u5C06\u4E8B\u4EF6\u6307\u5B9A\u7ED9\u4EFB\u4F55"),wt=a("code"),cs=o("\u5757"),ds=o("\u7EC4\u4EF6\u3002\u8FD9\u5C06\u5728\u7EC4\u4EF6\u88AB\u5355\u51FB\u3001\u66F4\u6539\u7B49\u60C5\u51B5\u4E0B\u8FD0\u884C\u51FD\u6570\u3002\u5F53\u4F60\u5206\u914D\u4E00\u4E2A\u4E8B\u4EF6\u65F6, \u4F60\u4F20\u5165\u4E09\u4E2A\u53C2\u6570: "),gt=a("code"),us=o("fn"),fs=o(": \u5E94\u8BE5\u88AB\u8C03\u7528\u7684\u51FD\u6570, "),Et=a("code"),ms=o("inputs"),hs=o(": \u8F93\u5165\u7EC4\u4EF6\u7684(\u5217\u8868), \u4EE5\u53CA "),vt=a("code"),_s=o("outputs"),xs=o(": \u5E94\u8BE5\u88AB\u8C03\u7528\u7684\u8F93\u51FA\u7EC4\u4EF6\u7684(\u5217\u8868)\u3002"),bs=d(),f=a("p"),ws=o("\u5728\u4E0A\u9762\u7684\u793A\u4F8B\u4E2D, \u5F53\u540D\u4E3A "),yt=a("code"),gs=o("input"),Es=o(" \u7684 "),kt=a("code"),vs=o("Textbox"),ys=o(" \u4E2D\u7684\u503C\u53D1\u751F\u53D8\u5316\u65F6, \u6211\u4EEC\u8FD0\u884C "),jt=a("code"),ks=o("flip_text()"),js=o(" \u51FD\u6570\u3002\u8BE5\u4E8B\u4EF6\u8BFB\u53D6"),$t=a("code"),$s=o("\u8F93\u5165"),Cs=o("\u4E2D\u7684\u503C, \u5C06\u5176\u4F5C\u4E3A\u540D\u79F0\u53C2\u6570\u4F20\u9012\u7ED9 "),Ct=a("code"),Ts=o("flip_text()"),Ps=o(", \u7136\u540E\u5B83\u8FD4\u56DE\u4E00\u4E2A\u503C, \u8BE5\u503C\u88AB\u5206\u914D\u7ED9\u6211\u4EEC\u7684\u7B2C\u4E8C\u4E2A\u540D\u4E3A "),Tt=a("code"),qs=o("output"),Ds=o(" \u7684 "),Pt=a("code"),Os=o("Textbox"),Is=o("\u3002"),As=d(),ve=a("p"),Bs=o("\u8981\u67E5\u770B\u6BCF\u4E2A\u7EC4\u4EF6\u652F\u6301\u7684\u4E8B\u4EF6\u5217\u8868, \u8BF7\u53C2\u9605 Gradio "),ye=a("a"),Fs=o("\u6587\u6863"),Ss=o("\u3002"),Ls=d(),qt=a("li"),I=a("p"),Rs=o("\u5757\u4F1A\u6839\u636E\u4F60\u5B9A\u4E49\u7684\u4E8B\u4EF6\u89E6\u53D1\u5668\u81EA\u52A8\u786E\u5B9A\u7EC4\u4EF6\u662F\u5426\u5E94\u8BE5\u662F\u4EA4\u4E92\u5F0F\u7684 (\u63A5\u53D7\u7528\u6237\u8F93\u5165)\u3002\u5728\u6211\u4EEC\u7684\u793A\u4F8B\u4E2D, \u7B2C\u4E00\u4E2A\u6587\u672C\u6846\u662F\u4EA4\u4E92\u5F0F\u7684, \u56E0\u4E3A\u5B83\u7684\u503C\u7531 "),Dt=a("code"),Gs=o("flip_text()"),Ms=o(" \u51FD\u6570\u4F7F\u7528\u3002\u7B2C\u4E8C\u4E2A\u6587\u672C\u6846\u4E0D\u662F\u4EA4\u4E92\u5F0F\u7684, \u56E0\u4E3A\u5B83\u7684\u503C\u4ECE\u4E0D\u7528\u4F5C\u8F93\u5165\u3002\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B, \u4F60\u53EF\u80FD\u60F3\u8981\u8986\u76D6\u5B83, \u4F60\u53EF\u4EE5\u901A\u8FC7\u4F20\u9012\u4E00\u4E2A\u5E03\u5C14\u503C\u7ED9\u7EC4\u4EF6\u7684"),Ot=a("code"),Ns=o("\u4EA4\u4E92"),Hs=o("\u53C2\u6570(\u4F8B\u5982 "),It=a("code"),zs=o('gr.Textbox(placeholder="Flip this text", interactive=True)'),Us=o(")\u3002"),Tl=d(),ke=a("h3"),Ws=o("\u81EA\u5B9A\u4E49\u6F14\u793A\u7684\u5E03\u5C40"),Pl=d(),x=a("p"),Js=o("\u6211\u4EEC\u5982\u4F55\u4F7F\u7528"),At=a("code"),Ks=o("\u5757"),Qs=o("\u6765\u5B9A\u5236\u6211\u4EEC\u7684\u6F14\u793A\u7684\u5E03\u5C40? \u9ED8\u8BA4\u60C5\u51B5\u4E0B, "),Bt=a("code"),Vs=o("\u5757"),Xs=o("\u5728\u4E00\u5217\u4E2D\u5782\u76F4\u5448\u73B0\u521B\u5EFA\u7684\u7EC4\u4EF6\u3002\u4F60\u53EF\u4EE5\u901A\u8FC7\u4F7F\u7528 "),Ft=a("code"),Ys=o("with gradio.Column():"),Zs=o(" \u521B\u5EFA\u5176\u4ED6\u5217\u6216\u4F7F\u7528 "),St=a("code"),ea=o("with gradio.Row():"),ta=o(" \u521B\u5EFA\u5176\u4ED6\u884C\u5E76\u5728\u8FD9\u4E9B\u4E0A\u4E0B\u6587\u4E2D\u521B\u5EFA\u7EC4\u4EF6\u6765\u6539\u53D8\u8FD9\u4E00\u70B9\u3002"),ql=d(),P=a("p"),la=o("\u4F60\u5E94\u8BE5\u8BB0\u4F4F: \u5728 "),Lt=a("code"),oa=o("\u5217"),sa=o(" \u4E0B\u521B\u5EFA\u7684\u4EFB\u4F55\u7EC4\u4EF6(\u8FD9\u4E5F\u662F\u9ED8\u8BA4\u8BBE\u7F6E) \u90FD\u5C06\u5782\u76F4\u5E03\u5C40\u3002\u5728 "),Rt=a("code"),aa=o("Row"),ra=o(" \u4E0B\u521B\u5EFA\u7684\u4EFB\u4F55\u7EC4\u4EF6\u90FD\u5C06\u6C34\u5E73\u5E03\u5C40, \u7C7B\u4F3C\u4E8E "),je=a("a"),ia=o("Web \u5F00\u53D1\u4E2D\u7684 flexbox \u6A21\u578B"),pa=o("\u3002"),Dl=d(),q=a("p"),na=o("\u6700\u540E, \u4F60\u8FD8\u53EF\u4EE5\u4F7F\u7528 "),Gt=a("code"),ca=o("with gradio.Tabs()"),da=o(" \u4E0A\u4E0B\u6587\u7BA1\u7406\u5668\u4E3A\u60A8\u7684demo\u521B\u5EFA\u9009\u9879\u5361\u3002\u5728\u6B64\u4E0A\u4E0B\u6587\u4E2D, \u60A8\u53EF\u4EE5\u901A\u8FC7\u4F7F\u7528 "),Mt=a("code"),ua=o("gradio.TabItem(name_of_tab):"),fa=o(" \u6307\u5B9A\u6765\u521B\u5EFA\u591A\u4E2A\u9009\u9879\u5361\u3002\u5728 "),Nt=a("code"),ma=o("gradio.TabItem(name_of_tab):"),ha=o(" \u4E2D\u521B\u5EFA\u7684\u4EFB\u4F55\u7EC4\u4EF6\u90FD\u4F1A\u51FA\u73B0\u5728\u8BE5\u9009\u9879\u5361\u4E2D\u3002"),Ol=d(),oe=a("p"),_a=o("\u73B0\u5728\u8BA9\u6211\u4EEC\u5728demo\u4E2D\u6DFB\u52A0\u4E00\u4E2A "),Ht=a("code"),xa=o("flip_image()"),ba=o("\u51FD\u6570\u5E76\u6DFB\u52A0\u4E00\u4E2A\u7FFB\u8F6C\u56FE\u50CF\u7684\u65B0\u9009\u9879\u5361\u3002\u4E0B\u9762\u662F\u4E00\u4E2A\u5E26\u6709 2 \u4E2A\u9009\u9879\u5361\u7684\u793A\u4F8B, \u4E5F\u4F7F\u7528\u4E86\u4E00\u4E2A\u884C:"),Il=d(),N($e.$$.fragment),Al=d(),E=a("iframe"),Bl=d(),se=a("p"),wa=o("\u4F60\u4F1A\u6CE8\u610F\u5230, \u5728\u8FD9\u4E2A\u793A\u4F8B\u4E2D, \u6211\u4EEC\u8FD8\u5728\u6BCF\u4E2A\u9009\u9879\u5361\u4E2D\u521B\u5EFA\u4E86\u4E00\u4E2A "),zt=a("code"),ga=o("Button"),Ea=o(" \u7EC4\u4EF6, \u5E76\u4E14\u6211\u4EEC\u4E3A\u6BCF\u4E2A\u6309\u94AE\u5206\u914D\u4E86\u4E00\u4E2A\u70B9\u51FB\u4E8B\u4EF6,\u8FD9\u662F\u5B9E\u9645\u8FD0\u884C\u8BE5\u51FD\u6570\u7684\u4E8B\u4EF6\u3002"),Fl=d(),Ce=a("h3"),va=o("\u63A2\u7D22\u4E8B\u4EF6\u548C\u72B6\u6001"),Sl=d(),ae=a("p"),ya=o("\u6B63\u5982\u4F60\u53EF\u4EE5\u63A7\u5236\u5E03\u5C40\u4E00\u6837, "),Ut=a("code"),ka=o("\u5757"),ja=o(" \u53EF\u4EE5\u8BA9\u4F60\u5BF9\u89E6\u53D1\u51FD\u6570\u8C03\u7528\u7684\u4E8B\u4EF6\u8FDB\u884C\u7EC6\u7C92\u5EA6\u63A7\u5236\u3002\u6BCF\u4E2A\u7EC4\u4EF6\u548C\u8BB8\u591A\u5E03\u5C40\u90FD\u6709\u5B83\u4EEC\u652F\u6301\u7684\u7279\u5B9A\u4E8B\u4EF6\u3002"),Ll=d(),b=a("p"),$a=o("\u4F8B\u5982, "),Wt=a("code"),Ca=o("Textbox"),Ta=o(" \u7EC4\u4EF6\u6709\u4E24\u4E2A\u4E8B\u4EF6: "),Jt=a("code"),Pa=o("change()"),qa=o(" (\u5F53\u6587\u672C\u6846\u5185\u7684\u503C\u53D1\u751F\u53D8\u5316\u65F6), \u548C "),Kt=a("code"),Da=o("submit()"),Oa=o(" (\u5F53\u7528\u6237\u5728\u5173\u6CE8\u6587\u672C\u6846\u65F6\u6309\u4E0Benter\u952E)\u3002\u66F4\u590D\u6742\u7684\u7EC4\u4EF6\u53EF\u4EE5\u6709\u66F4\u591A\u7684\u4E8B\u4EF6: \u4F8B\u5982,"),Qt=a("code"),Ia=o("Audio"),Aa=o("\u7EC4\u4EF6\u4E5F\u6709\u5355\u72EC\u7684\u4E8B\u4EF6, \u7528\u4E8E\u64AD\u653E\u3001\u6E05\u9664\u3001\u6682\u505C\u97F3\u9891\u6587\u4EF6\u7B49\u3002\u8BF7\u53C2\u9605\u6587\u6863\u4E86\u89E3\u6BCF\u4E2A\u7EC4\u4EF6\u652F\u6301\u7684\u4E8B\u4EF6\u3002"),Rl=d(),F=a("p"),Ba=o("\u4F60\u53EF\u4EE5\u5C06\u4E8B\u4EF6\u89E6\u53D1\u5668\u9644\u52A0\u5230\u8FD9\u4E9B\u4E8B\u4EF6\u4E2D\u7684\u4E00\u4E2A\u3001\u4E00\u4E2A\u6216\u591A\u4E2A\u3002\u4F60\u53EF\u4EE5\u901A\u8FC7\u5728\u7EC4\u4EF6\u5B9E\u4F8B\u4E2D\u8C03\u7528\u4E8B\u4EF6\u540D\u79F0\u4F5C\u4E3A\u51FD\u6570\u6765\u521B\u5EFA\u4E00\u4E2A\u4E8B\u4EF6\u89E6\u53D1\u5668 \u2014 \u4F8B\u5982 "),Vt=a("code"),Fa=o("textbox.change(...)"),Sa=o(" \u6216 "),Xt=a("code"),La=o("btn.click(...)"),Ra=o("\u3002\u5982\u524D\u6240\u8FF0, \u8BE5\u51FD\u6570\u63A5\u53D7\u4E09\u4E2A\u53C2\u6570:"),Gl=d(),S=a("ul"),Le=a("li"),Yt=a("code"),Ga=o("fn"),Ma=o(": \u8981\u8FD0\u884C\u7684\u51FD\u6570"),Na=d(),Re=a("li"),Zt=a("code"),Ha=o("inputs"),za=o(": \u7EC4\u4EF6\u7684(\u5217\u8868), \u5176\u503C\u5E94\u4F5C\u4E3A\u51FD\u6570\u7684\u8F93\u5165\u53C2\u6570\u63D0\u4F9B\u3002\u6BCF\u4E2A\u7EC4\u4EF6\u7684\u503C\u6309\u987A\u5E8F\u6620\u5C04\u5230\u76F8\u5E94\u7684\u51FD\u6570\u53C2\u6570\u3002\u5982\u679C\u51FD\u6570\u4E0D\u5E26\u4EFB\u4F55\u53C2\u6570, \u5219\u6B64\u53C2\u6570\u53EF\u4EE5\u4E3A None\u3002"),Ua=d(),Ge=a("li"),el=a("code"),Wa=o("outputs"),Ja=o(": \u5E94\u6839\u636E\u51FD\u6570\u8FD4\u56DE\u7684\u503C\u66F4\u65B0\u5176\u503C\u7684\u7EC4\u4EF6(\u5217\u8868)\u3002\u6BCF\u4E2A\u8FD4\u56DE\u503C\u6309\u987A\u5E8F\u8BBE\u7F6E\u76F8\u5E94\u7EC4\u4EF6\u7684\u503C\u3002\u5982\u679C\u51FD\u6570\u4E0D\u8FD4\u56DE\u4EFB\u4F55\u5185\u5BB9, \u5219\u6B64\u53C2\u6570\u53EF\u4EE5\u4E3ANone\u3002"),Ml=d(),Me=a("p"),Ka=o("\u4F60\u751A\u81F3\u53EF\u4EE5\u4F7F\u8F93\u5165\u548C\u8F93\u51FA\u7EC4\u4EF6\u6210\u4E3A\u540C\u4E00\u4E2A\u7EC4\u4EF6, \u5C31\u50CF\u6211\u4EEC\u5728\u8FD9\u4E2A\u4F7F\u7528 GPT \u6A21\u578B\u8FDB\u884C\u6587\u672C\u8865\u5168\u7684\u793A\u4F8B\u4E2D\u6240\u505A\u7684\u90A3\u6837:"),Nl=d(),N(Te.$$.fragment),Hl=d(),v=a("iframe"),zl=d(),X=a("h3"),re=a("a"),tl=a("span"),N(Pe.$$.fragment),Qa=d(),ll=a("span"),Va=o("\u521B\u5EFA\u591A\u6B65demo"),Ul=d(),L=a("p"),Xa=o("\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B, \u60A8\u53EF\u80FD\u9700\u8981\u4E00\u4E2A "),ol=a("em"),Ya=o("\u591A\u6B65\u9AA4\u7684demo"),Za=o(", \u5176\u4E2D\u91CD\u7528\u4E00\u4E2A\u51FD\u6570\u7684\u8F93\u51FA\u4F5C\u4E3A\u4E0B\u4E00\u4E2A\u51FD\u6570\u7684\u8F93\u5165\u3002\u4F7F\u7528 "),sl=a("code"),er=o("\u5757"),tr=o(" \u5F88\u5BB9\u6613\u505A\u5230\u8FD9\u4E00\u70B9, \u56E0\u4E3A\u4F60\u53EF\u4EE5\u4F7F\u7528\u7EC4\u4EF6\u4F5C\u4E3A\u4E00\u4E2A\u4E8B\u4EF6\u89E6\u53D1\u5668\u7684\u8F93\u5165, \u4F46\u4F5C\u4E3A\u53E6\u4E00\u4E2A\u4E8B\u4EF6\u89E6\u53D1\u5668\u7684\u8F93\u51FA\u3002\u770B\u770B\u4E0B\u9762\u793A\u4F8B\u4E2D\u7684\u6587\u672C\u7EC4\u4EF6, \u5B83\u7684\u503C\u662F\u8BED\u97F3\u5230\u6587\u672C\u6A21\u578B\u7684\u7ED3\u679C, \u4F46\u4E5F\u88AB\u4F20\u9012\u5230\u60C5\u611F\u5206\u6790\u6A21\u578B:"),Wl=d(),N(qe.$$.fragment),Jl=d(),y=a("iframe"),Kl=d(),De=a("h3"),lr=o("\u66F4\u65B0\u7EC4\u4EF6\u5C5E\u6027"),Ql=d(),ie=a("p"),or=o("\u5230\u76EE\u524D\u4E3A\u6B62, \u6211\u4EEC\u5DF2\u7ECF\u4E86\u89E3\u4E86\u5982\u4F55\u521B\u5EFA\u4E8B\u4EF6\u6765\u66F4\u65B0\u53E6\u4E00\u4E2A\u7EC4\u4EF6\u7684\u503C\u3002\u4F46\u662F, \u5982\u679C\u60A8\u60F3\u66F4\u6539\u7EC4\u4EF6\u7684\u5176\u4ED6\u5C5E\u6027, \u4F8B\u5982\u6587\u672C\u6846\u7684\u53EF\u89C1\u6027\u6216\u5355\u9009\u6309\u94AE\u7EC4\u4E2D\u7684\u9009\u9879, \u4F1A\u53D1\u751F\u4EC0\u4E48? \u60A8\u53EF\u4EE5\u901A\u8FC7\u8FD4\u56DE\u7EC4\u4EF6\u7C7B\u7684 "),al=a("code"),sr=o("update()"),ar=o(" \u65B9\u6CD5\u800C\u4E0D\u662F\u51FD\u6570\u7684\u5E38\u89C4\u8FD4\u56DE\u503C\u6765\u505A\u5230\u8FD9\u4E00\u70B9\u3002"),Vl=d(),Ne=a("p"),rr=o("\u8FD9\u5F88\u5BB9\u6613\u7528\u4E00\u4E2A\u4F8B\u5B50\u6765\u8BF4\u660E:"),Xl=d(),N(Oe.$$.fragment),Yl=d(),k=a("iframe"),Zl=d(),m=a("p"),ir=o("\u6211\u4EEC\u521A\u521A\u63A2\u7D22\u4E86"),rl=a("code"),pr=o("\u5757"),nr=o("\u7684\u6240\u6709\u6838\u5FC3\u6982\u5FF5! \u5C31\u50CF "),il=a("code"),cr=o("\u53C2\u6570\u4E00\u6837"),dr=o(", \u4F60\u53EF\u4EE5\u521B\u5EFA\u5F88\u9177\u7684demo, \u53EF\u4EE5\u901A\u8FC7\u5728"),pl=a("code"),ur=o("launch()"),fr=o("\u65B9\u6CD5\u4E2D\u4F7F\u7528"),nl=a("code"),mr=o("share=True"),hr=o("\u6765\u5171\u4EAB, \u6216\u8005\u90E8\u7F72\u5728"),Ie=a("a"),_r=o("Hugging Face Spaces"),xr=o("\u4E0A\u3002"),this.h()},l(e){const p=rp('[data-svelte="svelte-1phssyn"]',document.head);_=r(p,"META",{name:!0,content:!0}),p.forEach(l),A=u(e),O=r(e,"H1",{class:!0});var Ae=i(O);Y=r(Ae,"A",{id:!0,class:!0,href:!0});var Cr=i(Y);Qe=r(Cr,"SPAN",{});var Tr=i(Qe);H(he.$$.fragment,Tr),Tr.forEach(l),Cr.forEach(l),uo=u(Ae),Ve=r(Ae,"SPAN",{});var Pr=i(Ve);fo=s(Pr,"Gradio \u5757\u7B80\u4ECB"),Pr.forEach(l),Ae.forEach(l),ml=u(e),H(_e.$$.fragment,e),hl=u(e),j=r(e,"P",{});var pe=i(j);mo=s(pe,"\u5728\u524D\u9762\u7684\u90E8\u5206\u4E2D, \u6211\u4EEC\u5DF2\u7ECF\u4F7F\u7528 "),Xe=r(pe,"CODE",{});var qr=i(Xe);ho=s(qr,"Interface"),qr.forEach(l),_o=s(pe," \u7C7B\u63A2\u7D22\u5E76\u521B\u5EFA\u4E86\u6F14\u793A\u3002\u5728\u672C\u8282\u4E2D, \u6211\u4EEC\u5C06\u4ECB\u7ECD\u6211\u4EEC "),Ye=r(pe,"STRONG",{});var Dr=i(Ye);xo=s(Dr,"\u65B0\u5F00\u53D1"),Dr.forEach(l),bo=s(pe,"\u7684\u79F0\u4E3A"),Ze=r(pe,"CODE",{});var Or=i(Ze);wo=s(Or,"gradio.Blocks"),Or.forEach(l),go=s(pe,"\u4F4E\u7EA7API\u3002"),pe.forEach(l),_l=u(e),B=r(e,"P",{});var He=i(B);Eo=s(He,"\u73B0\u5728, "),et=r(He,"CODE",{});var Ir=i(et);vo=s(Ir,"\u63A5\u53E3"),Ir.forEach(l),yo=s(He,"\u548C"),tt=r(He,"CODE",{});var Ar=i(tt);ko=s(Ar,"\u5757"),Ar.forEach(l),jo=s(He,"\u4E4B\u95F4\u6709\u4EC0\u4E48\u533A\u522B?"),He.forEach(l),xl=u(e),Z=r(e,"UL",{});var to=i(Z);lt=r(to,"LI",{});var Br=i(lt);xe=r(Br,"P",{});var lo=i(xe);$o=s(lo,"\u26A1 "),ot=r(lo,"CODE",{});var Fr=i(ot);Co=s(Fr,"\u63A5\u53E3"),Fr.forEach(l),To=s(lo,": \u4E00\u4E2A\u9AD8\u7EA7 API, \u8BA9\u4F60\u53EA\u9700\u63D0\u4F9B\u8F93\u5165\u548C\u8F93\u51FA\u5217\u8868\u5373\u53EF\u521B\u5EFA\u5B8C\u6574\u7684\u673A\u5668\u5B66\u4E60\u6F14\u793A\u3002"),lo.forEach(l),Br.forEach(l),Po=u(to),st=r(to,"LI",{});var Sr=i(st);K=r(Sr,"P",{});var ze=i(K);qo=s(ze,"\u{1F9F1} "),at=r(ze,"CODE",{});var Lr=i(at);Do=s(Lr,"\u5757"),Lr.forEach(l),Oo=s(ze,": :\u4E00\u4E2A\u4F4E\u7EA7\u7684 API, \u5B83\u5141\u8BB8\u4F60\u5B8C\u5168\u63A7\u5236\u4F60\u7684\u5E94\u7528\u7A0B\u5E8F\u7684\u6570\u636E\u6D41\u548C\u5E03\u5C40\u3002\u60A8\u53EF\u4EE5\u4F7F\u7528"),rt=r(ze,"CODE",{});var Rr=i(rt);Io=s(Rr,"\u5757"),Rr.forEach(l),Ao=s(ze,"(\u5982 \u201C\u6784\u5EFA\u5757\u201D)\u6784\u5EFA\u975E\u5E38\u590D\u6742\u7684\u591A\u6B65\u9AA4\u5E94\u7528\u7A0B\u5E8F\u3002"),ze.forEach(l),Sr.forEach(l),to.forEach(l),bl=u(e),be=r(e,"H3",{id:!0});var Gr=i(be);Bo=s(Gr,"\u4E3A\u4EC0\u4E48\u8981\u5757 \u{1F9F1}?"),Gr.forEach(l),wl=u(e),$=r(e,"P",{});var ne=i($);Fo=s(ne,"\u6B63\u5982\u6211\u4EEC\u5728\u524D\u51E0\u8282\u4E2D\u770B\u5230\u7684, "),it=r(ne,"CODE",{});var Mr=i(it);So=s(Mr,"Interface"),Mr.forEach(l),Lo=s(ne," \u7C7B\u5141\u8BB8\u4F60\u4F7F\u7528\u51E0\u884C\u4EE3\u7801\u8F7B\u677E\u521B\u5EFA\u6210\u719F\u7684\u673A\u5668\u5B66\u4E60demo\u3002"),pt=r(ne,"CODE",{});var Nr=i(pt);Ro=s(Nr,"Interface"),Nr.forEach(l),Go=s(ne," API \u975E\u5E38\u6613\u4E8E\u4F7F\u7528, \u4F46\u7F3A\u4E4F "),nt=r(ne,"CODE",{});var Hr=i(nt);Mo=s(Hr,"Blocks"),Hr.forEach(l),No=s(ne," API \u63D0\u4F9B\u7684\u7075\u6D3B\u6027\u3002\u4F8B\u5982, \u4F60\u53EF\u80FD\u60F3\u8981:"),ne.forEach(l),gl=u(e),C=r(e,"UL",{});var ce=i(C);ct=r(ce,"LI",{});var zr=i(ct);Ho=s(zr,"\u5C06\u76F8\u5173\u6F14\u793A\u7EC4\u5408\u4E3A\u4E00\u4E2Aweb\u5E94\u7528\u7A0B\u5E8F\u4E2D\u7684\u591A\u4E2A\u9009\u9879\u5361"),zr.forEach(l),zo=u(ce),dt=r(ce,"LI",{});var Ur=i(dt);Uo=s(Ur,"\u66F4\u6539demo\u7684\u5E03\u5C40, \u4F8B\u5982\u6307\u5B9A\u8F93\u5165\u548C\u8F93\u51FA\u7684\u4F4D\u7F6E"),Ur.forEach(l),Wo=u(ce),ut=r(ce,"LI",{});var Wr=i(ut);Jo=s(Wr,"\u5177\u6709\u591A\u6B65\u9AA4\u63A5\u53E3, \u5176\u4E2D\u4E00\u4E2A\u6A21\u578B\u7684\u8F93\u51FA\u6210\u4E3A\u4E0B\u4E00\u4E2A\u6A21\u578B\u7684\u8F93\u5165, \u6216\u8005\u901A\u5E38\u5177\u6709\u66F4\u7075\u6D3B\u7684\u6570\u636E\u6D41"),Wr.forEach(l),Ko=u(ce),ft=r(ce,"LI",{});var Jr=i(ft);Qo=s(Jr,"\u6839\u636E\u7528\u6237\u8F93\u5165\u66F4\u6539\u7EC4\u4EF6\u7684\u5C5E\u6027 (\u4F8B\u5982, \u4E0B\u62C9\u5217\u8868\u4E2D\u7684\u9009\u9879) \u6216\u5176\u53EF\u89C1\u6027"),Jr.forEach(l),ce.forEach(l),El=u(e),Be=r(e,"P",{});var Kr=i(Be);Vo=s(Kr,"\u6211\u4EEC\u5C06\u5728\u4E0B\u9762\u63A2\u8BA8\u6240\u6709\u8FD9\u4E9B\u6982\u5FF5\u3002"),Kr.forEach(l),vl=u(e),Q=r(e,"H3",{class:!0});var oo=i(Q);ee=r(oo,"A",{id:!0,class:!0,href:!0});var Qr=i(ee);mt=r(Qr,"SPAN",{});var Vr=i(mt);H(we.$$.fragment,Vr),Vr.forEach(l),Qr.forEach(l),Xo=u(oo),ht=r(oo,"SPAN",{});var Xr=i(ht);Yo=s(Xr,"\u4F7F\u7528\u5757\u521B\u5EFA\u7B80\u5355demo"),Xr.forEach(l),oo.forEach(l),yl=u(e),Fe=r(e,"P",{});var Yr=i(Fe);Zo=s(Yr,"\u5B89\u88C5 Gradio \u540E, \u5C06\u4EE5\u4E0B\u4EE3\u7801\u4F5C\u4E3A Python \u811A\u672C\u3001Jupyter \u7B14\u8BB0\u672C\u6216 Colab \u7B14\u8BB0\u672C\u8FD0\u884C\u3002"),Yr.forEach(l),kl=u(e),H(ge.$$.fragment,e),jl=u(e),w=r(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),i(w).forEach(l),$l=u(e),Se=r(e,"P",{});var Zr=i(Se);es=s(Zr,"\u4E0A\u8FF0\u7B80\u5355\u793A\u4F8B\u4ECB\u7ECD\u4E86\u5757\u76844\u4E2A\u57FA\u672C\u6982\u5FF5:"),Zr.forEach(l),Cl=u(e),T=r(e,"OL",{});var de=i(T);te=r(de,"LI",{});var cl=i(te);_t=r(cl,"P",{});var ei=i(_t);ts=s(ei,"\u5757\u5141\u8BB8\u4F60\u5141\u8BB8\u4F60\u6784\u5EFA\u7ED3\u5408markdown\u3001HTML\u3001\u6309\u94AE\u548C\u4EA4\u4E92\u7EC4\u4EF6\u7684web\u5E94\u7528\u7A0B\u5E8F, \u53EA\u9700\u5728\u4E00\u4E2A\u5E26\u6709gradio\u7684Python\u4E2D\u5B9E\u4F8B\u5316\u5BF9\u8C61\u3002"),ei.forEach(l),ls=u(cl),H(le.$$.fragment,cl),os=s(cl,`
\u5B9E\u4F8B\u5316\u7EC4\u4EF6\u7684\u987A\u5E8F\u5F88\u91CD\u8981, \u56E0\u4E3A\u6BCF\u4E2A\u5143\u7D20\u90FD\u6309\u7167\u521B\u5EFA\u7684\u987A\u5E8F\u5448\u73B0\u5230 Web \u5E94\u7528\u7A0B\u5E8F\u4E2D\u3002(\u66F4\u590D\u6742\u7684\u5E03\u5C40\u5728\u4E0B\u9762\u8BA8\u8BBA)`),cl.forEach(l),ss=u(de),xt=r(de,"LI",{});var ti=i(xt);Ee=r(ti,"P",{});var so=i(Ee);as=s(so,"\u4F60\u53EF\u4EE5\u5728\u4EE3\u7801\u4E2D\u7684\u4EFB\u4F55\u4F4D\u7F6E\u5B9A\u4E49\u5E38\u89C4 Python \u51FD\u6570, \u5E76\u4F7F\u7528"),bt=r(so,"CODE",{});var li=i(bt);rs=s(li,"\u5757"),li.forEach(l),is=s(so,"\u5728\u7528\u6237\u8F93\u5165\u7684\u60C5\u51B5\u4E0B\u8FD0\u884C\u5B83\u4EEC\u3002\u5728\u6211\u4EEC\u7684\u793A\u4F8B\u4E2D, \u4EEC\u6709\u4E00\u4E2A\u201D\u7FFB\u8F6C\u201D\u8F93\u5165\u6587\u672C\u7684\u7B80\u5355\u51FD\u6570, \u4F46\u4F60\u53EF\u4EE5\u7F16\u5199\u4EFB\u4F55 Python \u51FD\u6570, \u4ECE\u7B80\u5355\u7684\u8BA1\u7B97\u5230\u5904\u7406\u673A\u5668\u5B66\u4E60\u6A21\u578B\u7684\u9884\u6D4B\u3002"),so.forEach(l),ti.forEach(l),ps=u(de),V=r(de,"LI",{});var Ue=i(V);g=r(Ue,"P",{});var R=i(g);ns=s(R,"\u4F60\u53EF\u4EE5\u5C06\u4E8B\u4EF6\u6307\u5B9A\u7ED9\u4EFB\u4F55"),wt=r(R,"CODE",{});var oi=i(wt);cs=s(oi,"\u5757"),oi.forEach(l),ds=s(R,"\u7EC4\u4EF6\u3002\u8FD9\u5C06\u5728\u7EC4\u4EF6\u88AB\u5355\u51FB\u3001\u66F4\u6539\u7B49\u60C5\u51B5\u4E0B\u8FD0\u884C\u51FD\u6570\u3002\u5F53\u4F60\u5206\u914D\u4E00\u4E2A\u4E8B\u4EF6\u65F6, \u4F60\u4F20\u5165\u4E09\u4E2A\u53C2\u6570: "),gt=r(R,"CODE",{});var si=i(gt);us=s(si,"fn"),si.forEach(l),fs=s(R,": \u5E94\u8BE5\u88AB\u8C03\u7528\u7684\u51FD\u6570, "),Et=r(R,"CODE",{});var ai=i(Et);ms=s(ai,"inputs"),ai.forEach(l),hs=s(R,": \u8F93\u5165\u7EC4\u4EF6\u7684(\u5217\u8868), \u4EE5\u53CA "),vt=r(R,"CODE",{});var ri=i(vt);_s=s(ri,"outputs"),ri.forEach(l),xs=s(R,": \u5E94\u8BE5\u88AB\u8C03\u7528\u7684\u8F93\u51FA\u7EC4\u4EF6\u7684(\u5217\u8868)\u3002"),R.forEach(l),bs=u(Ue),f=r(Ue,"P",{});var h=i(f);ws=s(h,"\u5728\u4E0A\u9762\u7684\u793A\u4F8B\u4E2D, \u5F53\u540D\u4E3A "),yt=r(h,"CODE",{});var ii=i(yt);gs=s(ii,"input"),ii.forEach(l),Es=s(h," \u7684 "),kt=r(h,"CODE",{});var pi=i(kt);vs=s(pi,"Textbox"),pi.forEach(l),ys=s(h," \u4E2D\u7684\u503C\u53D1\u751F\u53D8\u5316\u65F6, \u6211\u4EEC\u8FD0\u884C "),jt=r(h,"CODE",{});var ni=i(jt);ks=s(ni,"flip_text()"),ni.forEach(l),js=s(h," \u51FD\u6570\u3002\u8BE5\u4E8B\u4EF6\u8BFB\u53D6"),$t=r(h,"CODE",{});var ci=i($t);$s=s(ci,"\u8F93\u5165"),ci.forEach(l),Cs=s(h,"\u4E2D\u7684\u503C, \u5C06\u5176\u4F5C\u4E3A\u540D\u79F0\u53C2\u6570\u4F20\u9012\u7ED9 "),Ct=r(h,"CODE",{});var di=i(Ct);Ts=s(di,"flip_text()"),di.forEach(l),Ps=s(h,", \u7136\u540E\u5B83\u8FD4\u56DE\u4E00\u4E2A\u503C, \u8BE5\u503C\u88AB\u5206\u914D\u7ED9\u6211\u4EEC\u7684\u7B2C\u4E8C\u4E2A\u540D\u4E3A "),Tt=r(h,"CODE",{});var ui=i(Tt);qs=s(ui,"output"),ui.forEach(l),Ds=s(h," \u7684 "),Pt=r(h,"CODE",{});var fi=i(Pt);Os=s(fi,"Textbox"),fi.forEach(l),Is=s(h,"\u3002"),h.forEach(l),As=u(Ue),ve=r(Ue,"P",{});var ao=i(ve);Bs=s(ao,"\u8981\u67E5\u770B\u6BCF\u4E2A\u7EC4\u4EF6\u652F\u6301\u7684\u4E8B\u4EF6\u5217\u8868, \u8BF7\u53C2\u9605 Gradio "),ye=r(ao,"A",{href:!0,rel:!0});var mi=i(ye);Fs=s(mi,"\u6587\u6863"),mi.forEach(l),Ss=s(ao,"\u3002"),ao.forEach(l),Ue.forEach(l),Ls=u(de),qt=r(de,"LI",{});var hi=i(qt);I=r(hi,"P",{});var ue=i(I);Rs=s(ue,"\u5757\u4F1A\u6839\u636E\u4F60\u5B9A\u4E49\u7684\u4E8B\u4EF6\u89E6\u53D1\u5668\u81EA\u52A8\u786E\u5B9A\u7EC4\u4EF6\u662F\u5426\u5E94\u8BE5\u662F\u4EA4\u4E92\u5F0F\u7684 (\u63A5\u53D7\u7528\u6237\u8F93\u5165)\u3002\u5728\u6211\u4EEC\u7684\u793A\u4F8B\u4E2D, \u7B2C\u4E00\u4E2A\u6587\u672C\u6846\u662F\u4EA4\u4E92\u5F0F\u7684, \u56E0\u4E3A\u5B83\u7684\u503C\u7531 "),Dt=r(ue,"CODE",{});var _i=i(Dt);Gs=s(_i,"flip_text()"),_i.forEach(l),Ms=s(ue," \u51FD\u6570\u4F7F\u7528\u3002\u7B2C\u4E8C\u4E2A\u6587\u672C\u6846\u4E0D\u662F\u4EA4\u4E92\u5F0F\u7684, \u56E0\u4E3A\u5B83\u7684\u503C\u4ECE\u4E0D\u7528\u4F5C\u8F93\u5165\u3002\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B, \u4F60\u53EF\u80FD\u60F3\u8981\u8986\u76D6\u5B83, \u4F60\u53EF\u4EE5\u901A\u8FC7\u4F20\u9012\u4E00\u4E2A\u5E03\u5C14\u503C\u7ED9\u7EC4\u4EF6\u7684"),Ot=r(ue,"CODE",{});var xi=i(Ot);Ns=s(xi,"\u4EA4\u4E92"),xi.forEach(l),Hs=s(ue,"\u53C2\u6570(\u4F8B\u5982 "),It=r(ue,"CODE",{});var bi=i(It);zs=s(bi,'gr.Textbox(placeholder="Flip this text", interactive=True)'),bi.forEach(l),Us=s(ue,")\u3002"),ue.forEach(l),hi.forEach(l),de.forEach(l),Tl=u(e),ke=r(e,"H3",{id:!0});var wi=i(ke);Ws=s(wi,"\u81EA\u5B9A\u4E49\u6F14\u793A\u7684\u5E03\u5C40"),wi.forEach(l),Pl=u(e),x=r(e,"P",{});var G=i(x);Js=s(G,"\u6211\u4EEC\u5982\u4F55\u4F7F\u7528"),At=r(G,"CODE",{});var gi=i(At);Ks=s(gi,"\u5757"),gi.forEach(l),Qs=s(G,"\u6765\u5B9A\u5236\u6211\u4EEC\u7684\u6F14\u793A\u7684\u5E03\u5C40? \u9ED8\u8BA4\u60C5\u51B5\u4E0B, "),Bt=r(G,"CODE",{});var Ei=i(Bt);Vs=s(Ei,"\u5757"),Ei.forEach(l),Xs=s(G,"\u5728\u4E00\u5217\u4E2D\u5782\u76F4\u5448\u73B0\u521B\u5EFA\u7684\u7EC4\u4EF6\u3002\u4F60\u53EF\u4EE5\u901A\u8FC7\u4F7F\u7528 "),Ft=r(G,"CODE",{});var vi=i(Ft);Ys=s(vi,"with gradio.Column():"),vi.forEach(l),Zs=s(G," \u521B\u5EFA\u5176\u4ED6\u5217\u6216\u4F7F\u7528 "),St=r(G,"CODE",{});var yi=i(St);ea=s(yi,"with gradio.Row():"),yi.forEach(l),ta=s(G," \u521B\u5EFA\u5176\u4ED6\u884C\u5E76\u5728\u8FD9\u4E9B\u4E0A\u4E0B\u6587\u4E2D\u521B\u5EFA\u7EC4\u4EF6\u6765\u6539\u53D8\u8FD9\u4E00\u70B9\u3002"),G.forEach(l),ql=u(e),P=r(e,"P",{});var fe=i(P);la=s(fe,"\u4F60\u5E94\u8BE5\u8BB0\u4F4F: \u5728 "),Lt=r(fe,"CODE",{});var ki=i(Lt);oa=s(ki,"\u5217"),ki.forEach(l),sa=s(fe," \u4E0B\u521B\u5EFA\u7684\u4EFB\u4F55\u7EC4\u4EF6(\u8FD9\u4E5F\u662F\u9ED8\u8BA4\u8BBE\u7F6E) \u90FD\u5C06\u5782\u76F4\u5E03\u5C40\u3002\u5728 "),Rt=r(fe,"CODE",{});var ji=i(Rt);aa=s(ji,"Row"),ji.forEach(l),ra=s(fe," \u4E0B\u521B\u5EFA\u7684\u4EFB\u4F55\u7EC4\u4EF6\u90FD\u5C06\u6C34\u5E73\u5E03\u5C40, \u7C7B\u4F3C\u4E8E "),je=r(fe,"A",{href:!0,rel:!0});var $i=i(je);ia=s($i,"Web \u5F00\u53D1\u4E2D\u7684 flexbox \u6A21\u578B"),$i.forEach(l),pa=s(fe,"\u3002"),fe.forEach(l),Dl=u(e),q=r(e,"P",{});var me=i(q);na=s(me,"\u6700\u540E, \u4F60\u8FD8\u53EF\u4EE5\u4F7F\u7528 "),Gt=r(me,"CODE",{});var Ci=i(Gt);ca=s(Ci,"with gradio.Tabs()"),Ci.forEach(l),da=s(me," \u4E0A\u4E0B\u6587\u7BA1\u7406\u5668\u4E3A\u60A8\u7684demo\u521B\u5EFA\u9009\u9879\u5361\u3002\u5728\u6B64\u4E0A\u4E0B\u6587\u4E2D, \u60A8\u53EF\u4EE5\u901A\u8FC7\u4F7F\u7528 "),Mt=r(me,"CODE",{});var Ti=i(Mt);ua=s(Ti,"gradio.TabItem(name_of_tab):"),Ti.forEach(l),fa=s(me," \u6307\u5B9A\u6765\u521B\u5EFA\u591A\u4E2A\u9009\u9879\u5361\u3002\u5728 "),Nt=r(me,"CODE",{});var Pi=i(Nt);ma=s(Pi,"gradio.TabItem(name_of_tab):"),Pi.forEach(l),ha=s(me," \u4E2D\u521B\u5EFA\u7684\u4EFB\u4F55\u7EC4\u4EF6\u90FD\u4F1A\u51FA\u73B0\u5728\u8BE5\u9009\u9879\u5361\u4E2D\u3002"),me.forEach(l),Ol=u(e),oe=r(e,"P",{});var ro=i(oe);_a=s(ro,"\u73B0\u5728\u8BA9\u6211\u4EEC\u5728demo\u4E2D\u6DFB\u52A0\u4E00\u4E2A "),Ht=r(ro,"CODE",{});var qi=i(Ht);xa=s(qi,"flip_image()"),qi.forEach(l),ba=s(ro,"\u51FD\u6570\u5E76\u6DFB\u52A0\u4E00\u4E2A\u7FFB\u8F6C\u56FE\u50CF\u7684\u65B0\u9009\u9879\u5361\u3002\u4E0B\u9762\u662F\u4E00\u4E2A\u5E26\u6709 2 \u4E2A\u9009\u9879\u5361\u7684\u793A\u4F8B, \u4E5F\u4F7F\u7528\u4E86\u4E00\u4E2A\u884C:"),ro.forEach(l),Il=u(e),H($e.$$.fragment,e),Al=u(e),E=r(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),i(E).forEach(l),Bl=u(e),se=r(e,"P",{});var io=i(se);wa=s(io,"\u4F60\u4F1A\u6CE8\u610F\u5230, \u5728\u8FD9\u4E2A\u793A\u4F8B\u4E2D, \u6211\u4EEC\u8FD8\u5728\u6BCF\u4E2A\u9009\u9879\u5361\u4E2D\u521B\u5EFA\u4E86\u4E00\u4E2A "),zt=r(io,"CODE",{});var Di=i(zt);ga=s(Di,"Button"),Di.forEach(l),Ea=s(io," \u7EC4\u4EF6, \u5E76\u4E14\u6211\u4EEC\u4E3A\u6BCF\u4E2A\u6309\u94AE\u5206\u914D\u4E86\u4E00\u4E2A\u70B9\u51FB\u4E8B\u4EF6,\u8FD9\u662F\u5B9E\u9645\u8FD0\u884C\u8BE5\u51FD\u6570\u7684\u4E8B\u4EF6\u3002"),io.forEach(l),Fl=u(e),Ce=r(e,"H3",{id:!0});var Oi=i(Ce);va=s(Oi,"\u63A2\u7D22\u4E8B\u4EF6\u548C\u72B6\u6001"),Oi.forEach(l),Sl=u(e),ae=r(e,"P",{});var po=i(ae);ya=s(po,"\u6B63\u5982\u4F60\u53EF\u4EE5\u63A7\u5236\u5E03\u5C40\u4E00\u6837, "),Ut=r(po,"CODE",{});var Ii=i(Ut);ka=s(Ii,"\u5757"),Ii.forEach(l),ja=s(po," \u53EF\u4EE5\u8BA9\u4F60\u5BF9\u89E6\u53D1\u51FD\u6570\u8C03\u7528\u7684\u4E8B\u4EF6\u8FDB\u884C\u7EC6\u7C92\u5EA6\u63A7\u5236\u3002\u6BCF\u4E2A\u7EC4\u4EF6\u548C\u8BB8\u591A\u5E03\u5C40\u90FD\u6709\u5B83\u4EEC\u652F\u6301\u7684\u7279\u5B9A\u4E8B\u4EF6\u3002"),po.forEach(l),Ll=u(e),b=r(e,"P",{});var M=i(b);$a=s(M,"\u4F8B\u5982, "),Wt=r(M,"CODE",{});var Ai=i(Wt);Ca=s(Ai,"Textbox"),Ai.forEach(l),Ta=s(M," \u7EC4\u4EF6\u6709\u4E24\u4E2A\u4E8B\u4EF6: "),Jt=r(M,"CODE",{});var Bi=i(Jt);Pa=s(Bi,"change()"),Bi.forEach(l),qa=s(M," (\u5F53\u6587\u672C\u6846\u5185\u7684\u503C\u53D1\u751F\u53D8\u5316\u65F6), \u548C "),Kt=r(M,"CODE",{});var Fi=i(Kt);Da=s(Fi,"submit()"),Fi.forEach(l),Oa=s(M," (\u5F53\u7528\u6237\u5728\u5173\u6CE8\u6587\u672C\u6846\u65F6\u6309\u4E0Benter\u952E)\u3002\u66F4\u590D\u6742\u7684\u7EC4\u4EF6\u53EF\u4EE5\u6709\u66F4\u591A\u7684\u4E8B\u4EF6: \u4F8B\u5982,"),Qt=r(M,"CODE",{});var Si=i(Qt);Ia=s(Si,"Audio"),Si.forEach(l),Aa=s(M,"\u7EC4\u4EF6\u4E5F\u6709\u5355\u72EC\u7684\u4E8B\u4EF6, \u7528\u4E8E\u64AD\u653E\u3001\u6E05\u9664\u3001\u6682\u505C\u97F3\u9891\u6587\u4EF6\u7B49\u3002\u8BF7\u53C2\u9605\u6587\u6863\u4E86\u89E3\u6BCF\u4E2A\u7EC4\u4EF6\u652F\u6301\u7684\u4E8B\u4EF6\u3002"),M.forEach(l),Rl=u(e),F=r(e,"P",{});var We=i(F);Ba=s(We,"\u4F60\u53EF\u4EE5\u5C06\u4E8B\u4EF6\u89E6\u53D1\u5668\u9644\u52A0\u5230\u8FD9\u4E9B\u4E8B\u4EF6\u4E2D\u7684\u4E00\u4E2A\u3001\u4E00\u4E2A\u6216\u591A\u4E2A\u3002\u4F60\u53EF\u4EE5\u901A\u8FC7\u5728\u7EC4\u4EF6\u5B9E\u4F8B\u4E2D\u8C03\u7528\u4E8B\u4EF6\u540D\u79F0\u4F5C\u4E3A\u51FD\u6570\u6765\u521B\u5EFA\u4E00\u4E2A\u4E8B\u4EF6\u89E6\u53D1\u5668 \u2014 \u4F8B\u5982 "),Vt=r(We,"CODE",{});var Li=i(Vt);Fa=s(Li,"textbox.change(...)"),Li.forEach(l),Sa=s(We," \u6216 "),Xt=r(We,"CODE",{});var Ri=i(Xt);La=s(Ri,"btn.click(...)"),Ri.forEach(l),Ra=s(We,"\u3002\u5982\u524D\u6240\u8FF0, \u8BE5\u51FD\u6570\u63A5\u53D7\u4E09\u4E2A\u53C2\u6570:"),We.forEach(l),Gl=u(e),S=r(e,"UL",{});var Je=i(S);Le=r(Je,"LI",{});var br=i(Le);Yt=r(br,"CODE",{});var Gi=i(Yt);Ga=s(Gi,"fn"),Gi.forEach(l),Ma=s(br,": \u8981\u8FD0\u884C\u7684\u51FD\u6570"),br.forEach(l),Na=u(Je),Re=r(Je,"LI",{});var wr=i(Re);Zt=r(wr,"CODE",{});var Mi=i(Zt);Ha=s(Mi,"inputs"),Mi.forEach(l),za=s(wr,": \u7EC4\u4EF6\u7684(\u5217\u8868), \u5176\u503C\u5E94\u4F5C\u4E3A\u51FD\u6570\u7684\u8F93\u5165\u53C2\u6570\u63D0\u4F9B\u3002\u6BCF\u4E2A\u7EC4\u4EF6\u7684\u503C\u6309\u987A\u5E8F\u6620\u5C04\u5230\u76F8\u5E94\u7684\u51FD\u6570\u53C2\u6570\u3002\u5982\u679C\u51FD\u6570\u4E0D\u5E26\u4EFB\u4F55\u53C2\u6570, \u5219\u6B64\u53C2\u6570\u53EF\u4EE5\u4E3A None\u3002"),wr.forEach(l),Ua=u(Je),Ge=r(Je,"LI",{});var gr=i(Ge);el=r(gr,"CODE",{});var Ni=i(el);Wa=s(Ni,"outputs"),Ni.forEach(l),Ja=s(gr,": \u5E94\u6839\u636E\u51FD\u6570\u8FD4\u56DE\u7684\u503C\u66F4\u65B0\u5176\u503C\u7684\u7EC4\u4EF6(\u5217\u8868)\u3002\u6BCF\u4E2A\u8FD4\u56DE\u503C\u6309\u987A\u5E8F\u8BBE\u7F6E\u76F8\u5E94\u7EC4\u4EF6\u7684\u503C\u3002\u5982\u679C\u51FD\u6570\u4E0D\u8FD4\u56DE\u4EFB\u4F55\u5185\u5BB9, \u5219\u6B64\u53C2\u6570\u53EF\u4EE5\u4E3ANone\u3002"),gr.forEach(l),Je.forEach(l),Ml=u(e),Me=r(e,"P",{});var Hi=i(Me);Ka=s(Hi,"\u4F60\u751A\u81F3\u53EF\u4EE5\u4F7F\u8F93\u5165\u548C\u8F93\u51FA\u7EC4\u4EF6\u6210\u4E3A\u540C\u4E00\u4E2A\u7EC4\u4EF6, \u5C31\u50CF\u6211\u4EEC\u5728\u8FD9\u4E2A\u4F7F\u7528 GPT \u6A21\u578B\u8FDB\u884C\u6587\u672C\u8865\u5168\u7684\u793A\u4F8B\u4E2D\u6240\u505A\u7684\u90A3\u6837:"),Hi.forEach(l),Nl=u(e),H(Te.$$.fragment,e),Hl=u(e),v=r(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),i(v).forEach(l),zl=u(e),X=r(e,"H3",{class:!0});var no=i(X);re=r(no,"A",{id:!0,class:!0,href:!0});var zi=i(re);tl=r(zi,"SPAN",{});var Ui=i(tl);H(Pe.$$.fragment,Ui),Ui.forEach(l),zi.forEach(l),Qa=u(no),ll=r(no,"SPAN",{});var Wi=i(ll);Va=s(Wi,"\u521B\u5EFA\u591A\u6B65demo"),Wi.forEach(l),no.forEach(l),Ul=u(e),L=r(e,"P",{});var Ke=i(L);Xa=s(Ke,"\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B, \u60A8\u53EF\u80FD\u9700\u8981\u4E00\u4E2A "),ol=r(Ke,"EM",{});var Ji=i(ol);Ya=s(Ji,"\u591A\u6B65\u9AA4\u7684demo"),Ji.forEach(l),Za=s(Ke,", \u5176\u4E2D\u91CD\u7528\u4E00\u4E2A\u51FD\u6570\u7684\u8F93\u51FA\u4F5C\u4E3A\u4E0B\u4E00\u4E2A\u51FD\u6570\u7684\u8F93\u5165\u3002\u4F7F\u7528 "),sl=r(Ke,"CODE",{});var Ki=i(sl);er=s(Ki,"\u5757"),Ki.forEach(l),tr=s(Ke," \u5F88\u5BB9\u6613\u505A\u5230\u8FD9\u4E00\u70B9, \u56E0\u4E3A\u4F60\u53EF\u4EE5\u4F7F\u7528\u7EC4\u4EF6\u4F5C\u4E3A\u4E00\u4E2A\u4E8B\u4EF6\u89E6\u53D1\u5668\u7684\u8F93\u5165, \u4F46\u4F5C\u4E3A\u53E6\u4E00\u4E2A\u4E8B\u4EF6\u89E6\u53D1\u5668\u7684\u8F93\u51FA\u3002\u770B\u770B\u4E0B\u9762\u793A\u4F8B\u4E2D\u7684\u6587\u672C\u7EC4\u4EF6, \u5B83\u7684\u503C\u662F\u8BED\u97F3\u5230\u6587\u672C\u6A21\u578B\u7684\u7ED3\u679C, \u4F46\u4E5F\u88AB\u4F20\u9012\u5230\u60C5\u611F\u5206\u6790\u6A21\u578B:"),Ke.forEach(l),Wl=u(e),H(qe.$$.fragment,e),Jl=u(e),y=r(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),i(y).forEach(l),Kl=u(e),De=r(e,"H3",{id:!0});var Qi=i(De);lr=s(Qi,"\u66F4\u65B0\u7EC4\u4EF6\u5C5E\u6027"),Qi.forEach(l),Ql=u(e),ie=r(e,"P",{});var co=i(ie);or=s(co,"\u5230\u76EE\u524D\u4E3A\u6B62, \u6211\u4EEC\u5DF2\u7ECF\u4E86\u89E3\u4E86\u5982\u4F55\u521B\u5EFA\u4E8B\u4EF6\u6765\u66F4\u65B0\u53E6\u4E00\u4E2A\u7EC4\u4EF6\u7684\u503C\u3002\u4F46\u662F, \u5982\u679C\u60A8\u60F3\u66F4\u6539\u7EC4\u4EF6\u7684\u5176\u4ED6\u5C5E\u6027, \u4F8B\u5982\u6587\u672C\u6846\u7684\u53EF\u89C1\u6027\u6216\u5355\u9009\u6309\u94AE\u7EC4\u4E2D\u7684\u9009\u9879, \u4F1A\u53D1\u751F\u4EC0\u4E48? \u60A8\u53EF\u4EE5\u901A\u8FC7\u8FD4\u56DE\u7EC4\u4EF6\u7C7B\u7684 "),al=r(co,"CODE",{});var Vi=i(al);sr=s(Vi,"update()"),Vi.forEach(l),ar=s(co," \u65B9\u6CD5\u800C\u4E0D\u662F\u51FD\u6570\u7684\u5E38\u89C4\u8FD4\u56DE\u503C\u6765\u505A\u5230\u8FD9\u4E00\u70B9\u3002"),co.forEach(l),Vl=u(e),Ne=r(e,"P",{});var Xi=i(Ne);rr=s(Xi,"\u8FD9\u5F88\u5BB9\u6613\u7528\u4E00\u4E2A\u4F8B\u5B50\u6765\u8BF4\u660E:"),Xi.forEach(l),Xl=u(e),H(Oe.$$.fragment,e),Yl=u(e),k=r(e,"IFRAME",{src:!0,frameborder:!0,height:!0,title:!0,class:!0,allow:!0,sandbox:!0}),i(k).forEach(l),Zl=u(e),m=r(e,"P",{});var D=i(m);ir=s(D,"\u6211\u4EEC\u521A\u521A\u63A2\u7D22\u4E86"),rl=r(D,"CODE",{});var Yi=i(rl);pr=s(Yi,"\u5757"),Yi.forEach(l),nr=s(D,"\u7684\u6240\u6709\u6838\u5FC3\u6982\u5FF5! \u5C31\u50CF "),il=r(D,"CODE",{});var Zi=i(il);cr=s(Zi,"\u53C2\u6570\u4E00\u6837"),Zi.forEach(l),dr=s(D,", \u4F60\u53EF\u4EE5\u521B\u5EFA\u5F88\u9177\u7684demo, \u53EF\u4EE5\u901A\u8FC7\u5728"),pl=r(D,"CODE",{});var ep=i(pl);ur=s(ep,"launch()"),ep.forEach(l),fr=s(D,"\u65B9\u6CD5\u4E2D\u4F7F\u7528"),nl=r(D,"CODE",{});var tp=i(nl);mr=s(tp,"share=True"),tp.forEach(l),hr=s(D,"\u6765\u5171\u4EAB, \u6216\u8005\u90E8\u7F72\u5728"),Ie=r(D,"A",{href:!0,rel:!0});var lp=i(Ie);_r=s(lp,"Hugging Face Spaces"),lp.forEach(l),xr=s(D,"\u4E0A\u3002"),D.forEach(l),this.h()},h(){c(_,"name","hf:doc:metadata"),c(_,"content",JSON.stringify(up)),c(Y,"id","gradio"),c(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Y,"href","#gradio"),c(O,"class","relative group"),c(be,"id",""),c(ee,"id","demo"),c(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ee,"href","#demo"),c(Q,"class","relative group"),dl(w.src,vr="https://hf.space/gradioiframe/course-demos/flip_text/+")||c(w,"src",vr),c(w,"frameborder","0"),c(w,"height","400"),c(w,"title","Gradio app"),c(w,"class","container p-0 flex-grow space-iframe"),c(w,"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(w,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"),c(ye,"href","https://www.gradio.app/docs/"),c(ye,"rel","nofollow"),c(ke,"id",""),c(je,"href","https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox"),c(je,"rel","nofollow"),dl(E.src,yr="https://hf.space/gradioiframe/course-demos/flip_text_image/+")||c(E,"src",yr),c(E,"frameborder","0"),c(E,"height","450"),c(E,"title","Gradio app"),c(E,"class","container p-0 flex-grow space-iframe"),c(E,"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(E,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"),c(Ce,"id",""),dl(v.src,kr="https://hf.space/gradioiframe/course-demos/blocks_gpt/+")||c(v,"src",kr),c(v,"frameborder","0"),c(v,"height","300"),c(v,"title","Gradio app"),c(v,"class","container p-0 flex-grow space-iframe"),c(v,"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(v,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"),c(re,"id","demo"),c(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(re,"href","#demo"),c(X,"class","relative group"),dl(y.src,jr="https://hf.space/gradioiframe/course-demos/blocks_multi_step/+")||c(y,"src",jr),c(y,"frameborder","0"),c(y,"height","600"),c(y,"title","Gradio app"),c(y,"class","container p-0 flex-grow space-iframe"),c(y,"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(y,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"),c(De,"id",""),dl(k.src,$r="https://hf.space/gradioiframe/course-demos/blocks_update_component_properties/+")||c(k,"src",$r),c(k,"frameborder","0"),c(k,"height","300"),c(k,"title","Gradio app"),c(k,"class","container p-0 flex-grow space-iframe"),c(k,"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(k,"sandbox","allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"),c(Ie,"href","https://huggingface.co/spaces"),c(Ie,"rel","nofollow")},m(e,p){t(document.head,_),n(e,A,p),n(e,O,p),t(O,Y),t(Y,Qe),z(he,Qe,null),t(O,uo),t(O,Ve),t(Ve,fo),n(e,ml,p),z(_e,e,p),n(e,hl,p),n(e,j,p),t(j,mo),t(j,Xe),t(Xe,ho),t(j,_o),t(j,Ye),t(Ye,xo),t(j,bo),t(j,Ze),t(Ze,wo),t(j,go),n(e,_l,p),n(e,B,p),t(B,Eo),t(B,et),t(et,vo),t(B,yo),t(B,tt),t(tt,ko),t(B,jo),n(e,xl,p),n(e,Z,p),t(Z,lt),t(lt,xe),t(xe,$o),t(xe,ot),t(ot,Co),t(xe,To),t(Z,Po),t(Z,st),t(st,K),t(K,qo),t(K,at),t(at,Do),t(K,Oo),t(K,rt),t(rt,Io),t(K,Ao),n(e,bl,p),n(e,be,p),t(be,Bo),n(e,wl,p),n(e,$,p),t($,Fo),t($,it),t(it,So),t($,Lo),t($,pt),t(pt,Ro),t($,Go),t($,nt),t(nt,Mo),t($,No),n(e,gl,p),n(e,C,p),t(C,ct),t(ct,Ho),t(C,zo),t(C,dt),t(dt,Uo),t(C,Wo),t(C,ut),t(ut,Jo),t(C,Ko),t(C,ft),t(ft,Qo),n(e,El,p),n(e,Be,p),t(Be,Vo),n(e,vl,p),n(e,Q,p),t(Q,ee),t(ee,mt),z(we,mt,null),t(Q,Xo),t(Q,ht),t(ht,Yo),n(e,yl,p),n(e,Fe,p),t(Fe,Zo),n(e,kl,p),z(ge,e,p),n(e,jl,p),n(e,w,p),n(e,$l,p),n(e,Se,p),t(Se,es),n(e,Cl,p),n(e,T,p),t(T,te),t(te,_t),t(_t,ts),t(te,ls),z(le,te,null),t(te,os),t(T,ss),t(T,xt),t(xt,Ee),t(Ee,as),t(Ee,bt),t(bt,rs),t(Ee,is),t(T,ps),t(T,V),t(V,g),t(g,ns),t(g,wt),t(wt,cs),t(g,ds),t(g,gt),t(gt,us),t(g,fs),t(g,Et),t(Et,ms),t(g,hs),t(g,vt),t(vt,_s),t(g,xs),t(V,bs),t(V,f),t(f,ws),t(f,yt),t(yt,gs),t(f,Es),t(f,kt),t(kt,vs),t(f,ys),t(f,jt),t(jt,ks),t(f,js),t(f,$t),t($t,$s),t(f,Cs),t(f,Ct),t(Ct,Ts),t(f,Ps),t(f,Tt),t(Tt,qs),t(f,Ds),t(f,Pt),t(Pt,Os),t(f,Is),t(V,As),t(V,ve),t(ve,Bs),t(ve,ye),t(ye,Fs),t(ve,Ss),t(T,Ls),t(T,qt),t(qt,I),t(I,Rs),t(I,Dt),t(Dt,Gs),t(I,Ms),t(I,Ot),t(Ot,Ns),t(I,Hs),t(I,It),t(It,zs),t(I,Us),n(e,Tl,p),n(e,ke,p),t(ke,Ws),n(e,Pl,p),n(e,x,p),t(x,Js),t(x,At),t(At,Ks),t(x,Qs),t(x,Bt),t(Bt,Vs),t(x,Xs),t(x,Ft),t(Ft,Ys),t(x,Zs),t(x,St),t(St,ea),t(x,ta),n(e,ql,p),n(e,P,p),t(P,la),t(P,Lt),t(Lt,oa),t(P,sa),t(P,Rt),t(Rt,aa),t(P,ra),t(P,je),t(je,ia),t(P,pa),n(e,Dl,p),n(e,q,p),t(q,na),t(q,Gt),t(Gt,ca),t(q,da),t(q,Mt),t(Mt,ua),t(q,fa),t(q,Nt),t(Nt,ma),t(q,ha),n(e,Ol,p),n(e,oe,p),t(oe,_a),t(oe,Ht),t(Ht,xa),t(oe,ba),n(e,Il,p),z($e,e,p),n(e,Al,p),n(e,E,p),n(e,Bl,p),n(e,se,p),t(se,wa),t(se,zt),t(zt,ga),t(se,Ea),n(e,Fl,p),n(e,Ce,p),t(Ce,va),n(e,Sl,p),n(e,ae,p),t(ae,ya),t(ae,Ut),t(Ut,ka),t(ae,ja),n(e,Ll,p),n(e,b,p),t(b,$a),t(b,Wt),t(Wt,Ca),t(b,Ta),t(b,Jt),t(Jt,Pa),t(b,qa),t(b,Kt),t(Kt,Da),t(b,Oa),t(b,Qt),t(Qt,Ia),t(b,Aa),n(e,Rl,p),n(e,F,p),t(F,Ba),t(F,Vt),t(Vt,Fa),t(F,Sa),t(F,Xt),t(Xt,La),t(F,Ra),n(e,Gl,p),n(e,S,p),t(S,Le),t(Le,Yt),t(Yt,Ga),t(Le,Ma),t(S,Na),t(S,Re),t(Re,Zt),t(Zt,Ha),t(Re,za),t(S,Ua),t(S,Ge),t(Ge,el),t(el,Wa),t(Ge,Ja),n(e,Ml,p),n(e,Me,p),t(Me,Ka),n(e,Nl,p),z(Te,e,p),n(e,Hl,p),n(e,v,p),n(e,zl,p),n(e,X,p),t(X,re),t(re,tl),z(Pe,tl,null),t(X,Qa),t(X,ll),t(ll,Va),n(e,Ul,p),n(e,L,p),t(L,Xa),t(L,ol),t(ol,Ya),t(L,Za),t(L,sl),t(sl,er),t(L,tr),n(e,Wl,p),z(qe,e,p),n(e,Jl,p),n(e,y,p),n(e,Kl,p),n(e,De,p),t(De,lr),n(e,Ql,p),n(e,ie,p),t(ie,or),t(ie,al),t(al,sr),t(ie,ar),n(e,Vl,p),n(e,Ne,p),t(Ne,rr),n(e,Xl,p),z(Oe,e,p),n(e,Yl,p),n(e,k,p),n(e,Zl,p),n(e,m,p),t(m,ir),t(m,rl),t(rl,pr),t(m,nr),t(m,il),t(il,cr),t(m,dr),t(m,pl),t(pl,ur),t(m,fr),t(m,nl),t(nl,mr),t(m,hr),t(m,Ie),t(Ie,_r),t(m,xr),eo=!0},p(e,[p]){const Ae={};p&2&&(Ae.$$scope={dirty:p,ctx:e}),le.$set(Ae)},i(e){eo||(U(he.$$.fragment,e),U(_e.$$.fragment,e),U(we.$$.fragment,e),U(ge.$$.fragment,e),U(le.$$.fragment,e),U($e.$$.fragment,e),U(Te.$$.fragment,e),U(Pe.$$.fragment,e),U(qe.$$.fragment,e),U(Oe.$$.fragment,e),eo=!0)},o(e){W(he.$$.fragment,e),W(_e.$$.fragment,e),W(we.$$.fragment,e),W(ge.$$.fragment,e),W(le.$$.fragment,e),W($e.$$.fragment,e),W(Te.$$.fragment,e),W(Pe.$$.fragment,e),W(qe.$$.fragment,e),W(Oe.$$.fragment,e),eo=!1},d(e){l(_),e&&l(A),e&&l(O),J(he),e&&l(ml),J(_e,e),e&&l(hl),e&&l(j),e&&l(_l),e&&l(B),e&&l(xl),e&&l(Z),e&&l(bl),e&&l(be),e&&l(wl),e&&l($),e&&l(gl),e&&l(C),e&&l(El),e&&l(Be),e&&l(vl),e&&l(Q),J(we),e&&l(yl),e&&l(Fe),e&&l(kl),J(ge,e),e&&l(jl),e&&l(w),e&&l($l),e&&l(Se),e&&l(Cl),e&&l(T),J(le),e&&l(Tl),e&&l(ke),e&&l(Pl),e&&l(x),e&&l(ql),e&&l(P),e&&l(Dl),e&&l(q),e&&l(Ol),e&&l(oe),e&&l(Il),J($e,e),e&&l(Al),e&&l(E),e&&l(Bl),e&&l(se),e&&l(Fl),e&&l(Ce),e&&l(Sl),e&&l(ae),e&&l(Ll),e&&l(b),e&&l(Rl),e&&l(F),e&&l(Gl),e&&l(S),e&&l(Ml),e&&l(Me),e&&l(Nl),J(Te,e),e&&l(Hl),e&&l(v),e&&l(zl),e&&l(X),J(Pe),e&&l(Ul),e&&l(L),e&&l(Wl),J(qe,e),e&&l(Jl),e&&l(y),e&&l(Kl),e&&l(De),e&&l(Ql),e&&l(ie),e&&l(Vl),e&&l(Ne),e&&l(Xl),J(Oe,e),e&&l(Yl),e&&l(k),e&&l(Zl),e&&l(m)}}}const up={local:"gradio",sections:[{local:"",title:"\u4E3A\u4EC0\u4E48\u8981\u5757 \u{1F9F1}?"},{local:"demo",title:"\u4F7F\u7528\u5757\u521B\u5EFA\u7B80\u5355demo"},{local:"",title:"\u81EA\u5B9A\u4E49\u6F14\u793A\u7684\u5E03\u5C40"},{local:"",title:"\u63A2\u7D22\u4E8B\u4EF6\u548C\u72B6\u6001"},{local:"demo",title:"\u521B\u5EFA\u591A\u6B65demo"},{local:"",title:"\u66F4\u65B0\u7EC4\u4EF6\u5C5E\u6027"}],title:"Gradio \u5757\u7B80\u4ECB"};function fp(fl){return ip(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wp extends op{constructor(_){super();sp(this,_,fp,dp,ap,{})}}export{wp as default,up as metadata};
