import{S as oi,i as si,s as ai,e as a,k as d,w as N,t as o,M as ri,c as r,d as l,m as u,a as p,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 pi}from"../../chunks/vendor-hf-doc-builder.js";import{T as ii}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 ni}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function ci(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 di(fl){let _,A,O,Y,Qe,me,uo,Ve,fo,hl,_e,ml,j,ho,Xe,mo,_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,pt,So,Lo,it,Ro,Go,nt,Mo,No,gl,C,ct,Ho,zo,dt,Uo,Wo,ut,Jo,Ko,ft,Qo,El,Be,Vo,vl,Q,ee,ht,we,Xo,mt,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,ps,is,V,g,ns,wt,cs,ds,gt,us,fs,Et,hs,ms,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,pa,ia,Dl,q,na,Gt,ca,da,Mt,ua,fa,Nt,ha,ma,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,pe,or,al,sr,ar,Vl,Ne,rr,Xl,Oe,Yl,k,$r,Zl,h,pr,rl,ir,nr,pl,cr,dr,il,ur,fr,nl,hr,mr,Ie,_r,xr,eo;return me=new Er({}),_e=new ni({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 ii({props:{$$slots:{default:[ci]},$$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(me.$$.fragment),uo=d(),Ve=a("span"),fo=o("Gradio \u5757\u7B80\u4ECB"),hl=d(),N(_e.$$.fragment),ml=d(),j=a("p"),ho=o("\u5728\u524D\u9762\u7684\u90E8\u5206\u4E2D, \u6211\u4EEC\u5DF2\u7ECF\u4F7F\u7528 "),Xe=a("code"),mo=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, "),pt=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"),it=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"),ht=a("span"),N(we.$$.fragment),Xo=d(),mt=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"),ps=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"),is=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"),hs=o("inputs"),ms=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"),pa=o("Web \u5F00\u53D1\u4E2D\u7684 flexbox \u6A21\u578B"),ia=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"),ha=o("gradio.TabItem(name_of_tab):"),ma=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(),pe=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(),h=a("p"),pr=o("\u6211\u4EEC\u521A\u521A\u63A2\u7D22\u4E86"),rl=a("code"),ir=o("\u5757"),nr=o("\u7684\u6240\u6709\u6838\u5FC3\u6982\u5FF5! \u5C31\u50CF "),pl=a("code"),cr=o("\u53C2\u6570\u4E00\u6837"),dr=o(", \u4F60\u53EF\u4EE5\u521B\u5EFA\u5F88\u9177\u7684demo, \u53EF\u4EE5\u901A\u8FC7\u5728"),il=a("code"),ur=o("launch()"),fr=o("\u65B9\u6CD5\u4E2D\u4F7F\u7528"),nl=a("code"),hr=o("share=True"),mr=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 i=ri('[data-svelte="svelte-1phssyn"]',document.head);_=r(i,"META",{name:!0,content:!0}),i.forEach(l),A=u(e),O=r(e,"H1",{class:!0});var Ae=p(O);Y=r(Ae,"A",{id:!0,class:!0,href:!0});var Cr=p(Y);Qe=r(Cr,"SPAN",{});var Tr=p(Qe);H(me.$$.fragment,Tr),Tr.forEach(l),Cr.forEach(l),uo=u(Ae),Ve=r(Ae,"SPAN",{});var Pr=p(Ve);fo=s(Pr,"Gradio \u5757\u7B80\u4ECB"),Pr.forEach(l),Ae.forEach(l),hl=u(e),H(_e.$$.fragment,e),ml=u(e),j=r(e,"P",{});var ie=p(j);ho=s(ie,"\u5728\u524D\u9762\u7684\u90E8\u5206\u4E2D, \u6211\u4EEC\u5DF2\u7ECF\u4F7F\u7528 "),Xe=r(ie,"CODE",{});var qr=p(Xe);mo=s(qr,"Interface"),qr.forEach(l),_o=s(ie," \u7C7B\u63A2\u7D22\u5E76\u521B\u5EFA\u4E86\u6F14\u793A\u3002\u5728\u672C\u8282\u4E2D, \u6211\u4EEC\u5C06\u4ECB\u7ECD\u6211\u4EEC "),Ye=r(ie,"STRONG",{});var Dr=p(Ye);xo=s(Dr,"\u65B0\u5F00\u53D1"),Dr.forEach(l),bo=s(ie,"\u7684\u79F0\u4E3A"),Ze=r(ie,"CODE",{});var Or=p(Ze);wo=s(Or,"gradio.Blocks"),Or.forEach(l),go=s(ie,"\u4F4E\u7EA7API\u3002"),ie.forEach(l),_l=u(e),B=r(e,"P",{});var He=p(B);Eo=s(He,"\u73B0\u5728, "),et=r(He,"CODE",{});var Ir=p(et);vo=s(Ir,"\u63A5\u53E3"),Ir.forEach(l),yo=s(He,"\u548C"),tt=r(He,"CODE",{});var Ar=p(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=p(Z);lt=r(to,"LI",{});var Br=p(lt);xe=r(Br,"P",{});var lo=p(xe);$o=s(lo,"\u26A1 "),ot=r(lo,"CODE",{});var Fr=p(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=p(st);K=r(Sr,"P",{});var ze=p(K);qo=s(ze,"\u{1F9F1} "),at=r(ze,"CODE",{});var Lr=p(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=p(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=p(be);Bo=s(Gr,"\u4E3A\u4EC0\u4E48\u8981\u5757 \u{1F9F1}?"),Gr.forEach(l),wl=u(e),$=r(e,"P",{});var ne=p($);Fo=s(ne,"\u6B63\u5982\u6211\u4EEC\u5728\u524D\u51E0\u8282\u4E2D\u770B\u5230\u7684, "),pt=r(ne,"CODE",{});var Mr=p(pt);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"),it=r(ne,"CODE",{});var Nr=p(it);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=p(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=p(C);ct=r(ce,"LI",{});var zr=p(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=p(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=p(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=p(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=p(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=p(Q);ee=r(oo,"A",{id:!0,class:!0,href:!0});var Qr=p(ee);ht=r(Qr,"SPAN",{});var Vr=p(ht);H(we.$$.fragment,Vr),Vr.forEach(l),Qr.forEach(l),Xo=u(oo),mt=r(oo,"SPAN",{});var Xr=p(mt);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=p(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}),p(w).forEach(l),$l=u(e),Se=r(e,"P",{});var Zr=p(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=p(T);te=r(de,"LI",{});var cl=p(te);_t=r(cl,"P",{});var ep=p(_t);ts=s(ep,"\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"),ep.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 tp=p(xt);Ee=r(tp,"P",{});var so=p(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 lp=p(bt);rs=s(lp,"\u5757"),lp.forEach(l),ps=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),tp.forEach(l),is=u(de),V=r(de,"LI",{});var Ue=p(V);g=r(Ue,"P",{});var R=p(g);ns=s(R,"\u4F60\u53EF\u4EE5\u5C06\u4E8B\u4EF6\u6307\u5B9A\u7ED9\u4EFB\u4F55"),wt=r(R,"CODE",{});var op=p(wt);cs=s(op,"\u5757"),op.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 sp=p(gt);us=s(sp,"fn"),sp.forEach(l),fs=s(R,": \u5E94\u8BE5\u88AB\u8C03\u7528\u7684\u51FD\u6570, "),Et=r(R,"CODE",{});var ap=p(Et);hs=s(ap,"inputs"),ap.forEach(l),ms=s(R,": \u8F93\u5165\u7EC4\u4EF6\u7684(\u5217\u8868), \u4EE5\u53CA "),vt=r(R,"CODE",{});var rp=p(vt);_s=s(rp,"outputs"),rp.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 m=p(f);ws=s(m,"\u5728\u4E0A\u9762\u7684\u793A\u4F8B\u4E2D, \u5F53\u540D\u4E3A "),yt=r(m,"CODE",{});var pp=p(yt);gs=s(pp,"input"),pp.forEach(l),Es=s(m," \u7684 "),kt=r(m,"CODE",{});var ip=p(kt);vs=s(ip,"Textbox"),ip.forEach(l),ys=s(m," \u4E2D\u7684\u503C\u53D1\u751F\u53D8\u5316\u65F6, \u6211\u4EEC\u8FD0\u884C "),jt=r(m,"CODE",{});var np=p(jt);ks=s(np,"flip_text()"),np.forEach(l),js=s(m," \u51FD\u6570\u3002\u8BE5\u4E8B\u4EF6\u8BFB\u53D6"),$t=r(m,"CODE",{});var cp=p($t);$s=s(cp,"\u8F93\u5165"),cp.forEach(l),Cs=s(m,"\u4E2D\u7684\u503C, \u5C06\u5176\u4F5C\u4E3A\u540D\u79F0\u53C2\u6570\u4F20\u9012\u7ED9 "),Ct=r(m,"CODE",{});var dp=p(Ct);Ts=s(dp,"flip_text()"),dp.forEach(l),Ps=s(m,", \u7136\u540E\u5B83\u8FD4\u56DE\u4E00\u4E2A\u503C, \u8BE5\u503C\u88AB\u5206\u914D\u7ED9\u6211\u4EEC\u7684\u7B2C\u4E8C\u4E2A\u540D\u4E3A "),Tt=r(m,"CODE",{});var up=p(Tt);qs=s(up,"output"),up.forEach(l),Ds=s(m," \u7684 "),Pt=r(m,"CODE",{});var fp=p(Pt);Os=s(fp,"Textbox"),fp.forEach(l),Is=s(m,"\u3002"),m.forEach(l),As=u(Ue),ve=r(Ue,"P",{});var ao=p(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 hp=p(ye);Fs=s(hp,"\u6587\u6863"),hp.forEach(l),Ss=s(ao,"\u3002"),ao.forEach(l),Ue.forEach(l),Ls=u(de),qt=r(de,"LI",{});var mp=p(qt);I=r(mp,"P",{});var ue=p(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 _p=p(Dt);Gs=s(_p,"flip_text()"),_p.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 xp=p(Ot);Ns=s(xp,"\u4EA4\u4E92"),xp.forEach(l),Hs=s(ue,"\u53C2\u6570(\u4F8B\u5982 "),It=r(ue,"CODE",{});var bp=p(It);zs=s(bp,'gr.Textbox(placeholder="Flip this text", interactive=True)'),bp.forEach(l),Us=s(ue,")\u3002"),ue.forEach(l),mp.forEach(l),de.forEach(l),Tl=u(e),ke=r(e,"H3",{id:!0});var wp=p(ke);Ws=s(wp,"\u81EA\u5B9A\u4E49\u6F14\u793A\u7684\u5E03\u5C40"),wp.forEach(l),Pl=u(e),x=r(e,"P",{});var G=p(x);Js=s(G,"\u6211\u4EEC\u5982\u4F55\u4F7F\u7528"),At=r(G,"CODE",{});var gp=p(At);Ks=s(gp,"\u5757"),gp.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 Ep=p(Bt);Vs=s(Ep,"\u5757"),Ep.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 vp=p(Ft);Ys=s(vp,"with gradio.Column():"),vp.forEach(l),Zs=s(G," \u521B\u5EFA\u5176\u4ED6\u5217\u6216\u4F7F\u7528 "),St=r(G,"CODE",{});var yp=p(St);ea=s(yp,"with gradio.Row():"),yp.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=p(P);la=s(fe,"\u4F60\u5E94\u8BE5\u8BB0\u4F4F: \u5728 "),Lt=r(fe,"CODE",{});var kp=p(Lt);oa=s(kp,"\u5217"),kp.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 jp=p(Rt);aa=s(jp,"Row"),jp.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 $p=p(je);pa=s($p,"Web \u5F00\u53D1\u4E2D\u7684 flexbox \u6A21\u578B"),$p.forEach(l),ia=s(fe,"\u3002"),fe.forEach(l),Dl=u(e),q=r(e,"P",{});var he=p(q);na=s(he,"\u6700\u540E, \u4F60\u8FD8\u53EF\u4EE5\u4F7F\u7528 "),Gt=r(he,"CODE",{});var Cp=p(Gt);ca=s(Cp,"with gradio.Tabs()"),Cp.forEach(l),da=s(he," \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(he,"CODE",{});var Tp=p(Mt);ua=s(Tp,"gradio.TabItem(name_of_tab):"),Tp.forEach(l),fa=s(he," \u6307\u5B9A\u6765\u521B\u5EFA\u591A\u4E2A\u9009\u9879\u5361\u3002\u5728 "),Nt=r(he,"CODE",{});var Pp=p(Nt);ha=s(Pp,"gradio.TabItem(name_of_tab):"),Pp.forEach(l),ma=s(he," \u4E2D\u521B\u5EFA\u7684\u4EFB\u4F55\u7EC4\u4EF6\u90FD\u4F1A\u51FA\u73B0\u5728\u8BE5\u9009\u9879\u5361\u4E2D\u3002"),he.forEach(l),Ol=u(e),oe=r(e,"P",{});var ro=p(oe);_a=s(ro,"\u73B0\u5728\u8BA9\u6211\u4EEC\u5728demo\u4E2D\u6DFB\u52A0\u4E00\u4E2A "),Ht=r(ro,"CODE",{});var qp=p(Ht);xa=s(qp,"flip_image()"),qp.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}),p(E).forEach(l),Bl=u(e),se=r(e,"P",{});var po=p(se);wa=s(po,"\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(po,"CODE",{});var Dp=p(zt);ga=s(Dp,"Button"),Dp.forEach(l),Ea=s(po," \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"),po.forEach(l),Fl=u(e),Ce=r(e,"H3",{id:!0});var Op=p(Ce);va=s(Op,"\u63A2\u7D22\u4E8B\u4EF6\u548C\u72B6\u6001"),Op.forEach(l),Sl=u(e),ae=r(e,"P",{});var io=p(ae);ya=s(io,"\u6B63\u5982\u4F60\u53EF\u4EE5\u63A7\u5236\u5E03\u5C40\u4E00\u6837, "),Ut=r(io,"CODE",{});var Ip=p(Ut);ka=s(Ip,"\u5757"),Ip.forEach(l),ja=s(io," \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"),io.forEach(l),Ll=u(e),b=r(e,"P",{});var M=p(b);$a=s(M,"\u4F8B\u5982, "),Wt=r(M,"CODE",{});var Ap=p(Wt);Ca=s(Ap,"Textbox"),Ap.forEach(l),Ta=s(M," \u7EC4\u4EF6\u6709\u4E24\u4E2A\u4E8B\u4EF6: "),Jt=r(M,"CODE",{});var Bp=p(Jt);Pa=s(Bp,"change()"),Bp.forEach(l),qa=s(M," (\u5F53\u6587\u672C\u6846\u5185\u7684\u503C\u53D1\u751F\u53D8\u5316\u65F6), \u548C "),Kt=r(M,"CODE",{});var Fp=p(Kt);Da=s(Fp,"submit()"),Fp.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 Sp=p(Qt);Ia=s(Sp,"Audio"),Sp.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=p(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 Lp=p(Vt);Fa=s(Lp,"textbox.change(...)"),Lp.forEach(l),Sa=s(We," \u6216 "),Xt=r(We,"CODE",{});var Rp=p(Xt);La=s(Rp,"btn.click(...)"),Rp.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=p(S);Le=r(Je,"LI",{});var br=p(Le);Yt=r(br,"CODE",{});var Gp=p(Yt);Ga=s(Gp,"fn"),Gp.forEach(l),Ma=s(br,": \u8981\u8FD0\u884C\u7684\u51FD\u6570"),br.forEach(l),Na=u(Je),Re=r(Je,"LI",{});var wr=p(Re);Zt=r(wr,"CODE",{});var Mp=p(Zt);Ha=s(Mp,"inputs"),Mp.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=p(Ge);el=r(gr,"CODE",{});var Np=p(el);Wa=s(Np,"outputs"),Np.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 Hp=p(Me);Ka=s(Hp,"\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:"),Hp.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}),p(v).forEach(l),zl=u(e),X=r(e,"H3",{class:!0});var no=p(X);re=r(no,"A",{id:!0,class:!0,href:!0});var zp=p(re);tl=r(zp,"SPAN",{});var Up=p(tl);H(Pe.$$.fragment,Up),Up.forEach(l),zp.forEach(l),Qa=u(no),ll=r(no,"SPAN",{});var Wp=p(ll);Va=s(Wp,"\u521B\u5EFA\u591A\u6B65demo"),Wp.forEach(l),no.forEach(l),Ul=u(e),L=r(e,"P",{});var Ke=p(L);Xa=s(Ke,"\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B, \u60A8\u53EF\u80FD\u9700\u8981\u4E00\u4E2A "),ol=r(Ke,"EM",{});var Jp=p(ol);Ya=s(Jp,"\u591A\u6B65\u9AA4\u7684demo"),Jp.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 Kp=p(sl);er=s(Kp,"\u5757"),Kp.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}),p(y).forEach(l),Kl=u(e),De=r(e,"H3",{id:!0});var Qp=p(De);lr=s(Qp,"\u66F4\u65B0\u7EC4\u4EF6\u5C5E\u6027"),Qp.forEach(l),Ql=u(e),pe=r(e,"P",{});var co=p(pe);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 Vp=p(al);sr=s(Vp,"update()"),Vp.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 Xp=p(Ne);rr=s(Xp,"\u8FD9\u5F88\u5BB9\u6613\u7528\u4E00\u4E2A\u4F8B\u5B50\u6765\u8BF4\u660E:"),Xp.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}),p(k).forEach(l),Zl=u(e),h=r(e,"P",{});var D=p(h);pr=s(D,"\u6211\u4EEC\u521A\u521A\u63A2\u7D22\u4E86"),rl=r(D,"CODE",{});var Yp=p(rl);ir=s(Yp,"\u5757"),Yp.forEach(l),nr=s(D,"\u7684\u6240\u6709\u6838\u5FC3\u6982\u5FF5! \u5C31\u50CF "),pl=r(D,"CODE",{});var Zp=p(pl);cr=s(Zp,"\u53C2\u6570\u4E00\u6837"),Zp.forEach(l),dr=s(D,", \u4F60\u53EF\u4EE5\u521B\u5EFA\u5F88\u9177\u7684demo, \u53EF\u4EE5\u901A\u8FC7\u5728"),il=r(D,"CODE",{});var ei=p(il);ur=s(ei,"launch()"),ei.forEach(l),fr=s(D,"\u65B9\u6CD5\u4E2D\u4F7F\u7528"),nl=r(D,"CODE",{});var ti=p(nl);hr=s(ti,"share=True"),ti.forEach(l),mr=s(D,"\u6765\u5171\u4EAB, \u6216\u8005\u90E8\u7F72\u5728"),Ie=r(D,"A",{href:!0,rel:!0});var li=p(Ie);_r=s(li,"Hugging Face Spaces"),li.forEach(l),xr=s(D,"\u4E0A\u3002"),D.forEach(l),this.h()},h(){c(_,"name","hf:doc:metadata"),c(_,"content",JSON.stringify(ui)),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://course-demos-flip-text.hf.space")||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://course-demos-flip-text-image.hf.space")||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://course-demos-blocks-gpt.hf.space")||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://course-demos-blocks-multi-step.hf.space")||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://course-demos-blocks-update-component-properti-833c723.hf.space")||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,i){t(document.head,_),n(e,A,i),n(e,O,i),t(O,Y),t(Y,Qe),z(me,Qe,null),t(O,uo),t(O,Ve),t(Ve,fo),n(e,hl,i),z(_e,e,i),n(e,ml,i),n(e,j,i),t(j,ho),t(j,Xe),t(Xe,mo),t(j,_o),t(j,Ye),t(Ye,xo),t(j,bo),t(j,Ze),t(Ze,wo),t(j,go),n(e,_l,i),n(e,B,i),t(B,Eo),t(B,et),t(et,vo),t(B,yo),t(B,tt),t(tt,ko),t(B,jo),n(e,xl,i),n(e,Z,i),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,i),n(e,be,i),t(be,Bo),n(e,wl,i),n(e,$,i),t($,Fo),t($,pt),t(pt,So),t($,Lo),t($,it),t(it,Ro),t($,Go),t($,nt),t(nt,Mo),t($,No),n(e,gl,i),n(e,C,i),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,i),n(e,Be,i),t(Be,Vo),n(e,vl,i),n(e,Q,i),t(Q,ee),t(ee,ht),z(we,ht,null),t(Q,Xo),t(Q,mt),t(mt,Yo),n(e,yl,i),n(e,Fe,i),t(Fe,Zo),n(e,kl,i),z(ge,e,i),n(e,jl,i),n(e,w,i),n(e,$l,i),n(e,Se,i),t(Se,es),n(e,Cl,i),n(e,T,i),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,ps),t(T,is),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,hs),t(g,ms),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,i),n(e,ke,i),t(ke,Ws),n(e,Pl,i),n(e,x,i),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,i),n(e,P,i),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,pa),t(P,ia),n(e,Dl,i),n(e,q,i),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,ha),t(q,ma),n(e,Ol,i),n(e,oe,i),t(oe,_a),t(oe,Ht),t(Ht,xa),t(oe,ba),n(e,Il,i),z($e,e,i),n(e,Al,i),n(e,E,i),n(e,Bl,i),n(e,se,i),t(se,wa),t(se,zt),t(zt,ga),t(se,Ea),n(e,Fl,i),n(e,Ce,i),t(Ce,va),n(e,Sl,i),n(e,ae,i),t(ae,ya),t(ae,Ut),t(Ut,ka),t(ae,ja),n(e,Ll,i),n(e,b,i),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,i),n(e,F,i),t(F,Ba),t(F,Vt),t(Vt,Fa),t(F,Sa),t(F,Xt),t(Xt,La),t(F,Ra),n(e,Gl,i),n(e,S,i),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,i),n(e,Me,i),t(Me,Ka),n(e,Nl,i),z(Te,e,i),n(e,Hl,i),n(e,v,i),n(e,zl,i),n(e,X,i),t(X,re),t(re,tl),z(Pe,tl,null),t(X,Qa),t(X,ll),t(ll,Va),n(e,Ul,i),n(e,L,i),t(L,Xa),t(L,ol),t(ol,Ya),t(L,Za),t(L,sl),t(sl,er),t(L,tr),n(e,Wl,i),z(qe,e,i),n(e,Jl,i),n(e,y,i),n(e,Kl,i),n(e,De,i),t(De,lr),n(e,Ql,i),n(e,pe,i),t(pe,or),t(pe,al),t(al,sr),t(pe,ar),n(e,Vl,i),n(e,Ne,i),t(Ne,rr),n(e,Xl,i),z(Oe,e,i),n(e,Yl,i),n(e,k,i),n(e,Zl,i),n(e,h,i),t(h,pr),t(h,rl),t(rl,ir),t(h,nr),t(h,pl),t(pl,cr),t(h,dr),t(h,il),t(il,ur),t(h,fr),t(h,nl),t(nl,hr),t(h,mr),t(h,Ie),t(Ie,_r),t(h,xr),eo=!0},p(e,[i]){const Ae={};i&2&&(Ae.$$scope={dirty:i,ctx:e}),le.$set(Ae)},i(e){eo||(U(me.$$.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(me.$$.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(me),e&&l(hl),J(_e,e),e&&l(ml),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(pe),e&&l(Vl),e&&l(Ne),e&&l(Xl),J(Oe,e),e&&l(Yl),e&&l(k),e&&l(Zl),e&&l(h)}}}const ui={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 fi(fl){return pi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wi extends oi{constructor(_){super();si(this,_,fi,di,ai,{})}}export{wi as default,ui as metadata};
