{"id":2587,"date":"2023-04-23T04:02:08","date_gmt":"2023-04-22T20:02:08","guid":{"rendered":"https:\/\/www.shuizilong.com\/house\/?p=2587"},"modified":"2023-04-25T10:18:28","modified_gmt":"2023-04-25T02:18:28","slug":"introduction-to-gradio-client","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/","title":{"rendered":"gradio_client \u4ecb\u7ecd"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e474d04e579\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e474d04e579\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/#%E8%83%8C%E6%99%AF\" title=\"\u80cc\u666f\">\u80cc\u666f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/#%E4%BE%8B%E5%AD%90\" title=\"\u4f8b\u5b50\">\u4f8b\u5b50<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/#ChatGPT\" title=\"ChatGPT\">ChatGPT<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/#loveleaves2012ChatGPT\" title=\"loveleaves2012\/ChatGPT\">loveleaves2012\/ChatGPT<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/#ysharmaChatGPTwithAPI\" title=\"ysharma\/ChatGPTwithAPI\">ysharma\/ChatGPTwithAPI<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/#anzorqchatgpt-demo\" title=\"anzorq\/chatgpt-demo\">anzorq\/chatgpt-demo<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/#ChatGLM\" title=\"ChatGLM\">ChatGLM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/#Stable_Diffusion_21\" title=\"Stable Diffusion 2.1\">Stable Diffusion 2.1<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/#Further_Discussion\" title=\"Further Discussion\">Further Discussion<\/a><\/li><\/ul><\/nav><\/div>\n\n<p><a href=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2023\/04\/a058-hymscpq2721937.jpeg\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2613\" data-permalink=\"https:\/\/www.shuizilong.com\/house\/archives\/introduction-to-gradio-client\/a058-hymscpq2721937\/\" data-orig-file=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2023\/04\/a058-hymscpq2721937.jpeg\" data-orig-size=\"640,324\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"a058-hymscpq2721937\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2023\/04\/a058-hymscpq2721937-300x152.jpeg\" data-large-file=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2023\/04\/a058-hymscpq2721937.jpeg\" src=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2023\/04\/a058-hymscpq2721937.jpeg\" alt=\"\" width=\"640\" height=\"324\" class=\"aligncenter size-full wp-image-2613\" srcset=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2023\/04\/a058-hymscpq2721937.jpeg 640w, https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2023\/04\/a058-hymscpq2721937-300x152.jpeg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>\u968f\u7740\u6700\u8fd1 HuggingGPT \u548c AutoGPT \u7684\u706b\u7206\uff0c\u8ba9 LLM \u4f5c\u4e3a Control \u8c03\u7528\u5404\u79cd\u5404\u6837\u7684 Domain Expert Models \u4e5f\u6210\u4e3a\u4e86\u4e00\u4e2a\u5e38\u89c1\u7684\u9700\u6c42\u4e86\u3002<br \/>\n\u8fde Gradio <a href=\"https:\/\/twitter.com\/Gradio\/status\/1646656025179856896\">\u4e5f\u5728\u4e0a\u5468\u63a8\u51fa\u4e86 gradio_client<\/a> \u529f\u80fd\u3002<\/p>\n<p>\u987a\u5e26\u4e00\u63d0\u3002\u3002\u524d\u51e0\u5929 OpenAI \u4e09\u5de8\u5934\u4e4b\u4e00\u7684 GDB \u5728 Ted \u7ed9\u4e86\u4e00\u4e2a talk\uff0c\u4e5f\u518d\u6b21\u5411\u516c\u4f17\u79c0\u4e86\u4e00\u628a ChatGPT Plugin&#8230;<br \/>\n\u53ef\u60dc <a href=\"https:\/\/zhuanlan.zhihu.com\/p\/624258505\">\u91cf\u5b50\u4f4d\u7684\u8fd9\u7bc7\u62a5\u9053<\/a> \u660e\u663e\u662f\u6df7\u6dc6\u4e86 AutoGPT \u548c ChatGPT Plugin&#8230;<br \/>\n\u8c03\u6a21\u578b\u53ef\u4ee5\u7b97\u505a\u4f7f\u7528\u5de5\u5177\u7684\u4e00\u73af\uff0c\u4f46 AutoGPT \u6838\u5fc3\u7684 feature \u662f Auto \u554a\u3002<\/p>\n<p>\u603b\u4e4b\uff0c\u5148\u8ba9\u6211\u4eec\u770b\u770b gradio_client \u5177\u4f53\u90fd\u80fd\u505a\u4e9b\u4ec0\u4e48\u5427~\uff01<\/p>\n<h1><span class=\"ez-toc-section\" id=\"%E8%83%8C%E6%99%AF\"><\/span>\u80cc\u666f<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>\u5728\u5177\u4f53\u8ba8\u8bba <a href=\"https:\/\/gradio.app\/getting-started-with-the-python-client\/\">gradio_client<\/a> \u4e4b\u524d\uff0c\u6211\u4eec\u4e0d\u59a8\u7a0d\u5fae\u56de\u987e\u4e00\u4e0b\u5f53\u524d\u5f00\u53d1\u8005\u7684\u73b0\u72b6\uff0c\u968f\u7740 ChatGPT \u7684\u706b\u7206\u548c\u5176\u6781\u5176\u5ec9\u4ef7\u7684\uff0c\u8fd1\u4e4e\u4e8e\u503e\u9500\u7684\u5b9a\u4ef7\u6a21\u5f0f\uff0c\u4f7f\u5f97 OpenAI API \u5df2\u7ecf\u51e0\u4e4e\u6210\u4e3a\u6240\u6709\u5f00\u53d1\u8005\u7684\u6807\u914d\uff0c<a href=\"https:\/\/twitter.com\/9hills\/status\/1649315690514649089\">\u751a\u81f3\u8bb8\u591a\u5f00\u53d1\u8005\u90fd\u5c06\u5f00\u6e90 LLM \u5c01\u88c5\u6210\u7c7b\u4f3c OpenAI API \u7684\u8c03\u7528\u683c\u5f0f<\/a>\u3002\u5b9e\u9645\u4e0a\uff0c\u5229\u7528 <a href=\"https:\/\/gradio.app\/using-hugging-face-integrations\/\">HuggingFace Inference Endpoints<\/a>\uff0c\u4e5f\u53ef\u4ee5\u505a\u5230\u548c OpenAI API \u7c7b\u4f3c\u7684\u529f\u80fd\uff0c\u800c gradio_client \u5219\u53ef\u4ee5\u8ba9\u4e00\u4e2a Gradio \u7a0b\u5e8f\u5373\u4f7f\u8131\u79bb HuggingFace \u5e73\u53f0\uff0c\u4e5f\u4f9d\u7136\u4fdd\u6301\u901a\u4fe1\u3002<\/p>\n<p>\u8fd9\u4e4d\u770b\u8d77\u6765\u50cf\u662f\u67d0\u79cd <a href=\"https:\/\/www.shuizilong.com\/house\/archives\/global-game-jam-2023-%e5%8f%82%e8%b5%9b%e7%ba%aa%e5%bd%95\/\">\u53cd\u5c04\u9b54\u6cd5<\/a>\u3002\u3002\u3002\u76f4\u63a5\u5c31\u6784\u9020\u4e00\u4e2a\u7c7b\u7136\u540e import \u8fdb\u6765\u5b83\u7684 predict \u51fd\u6570\u4e86\uff1f<br \/>\n\u3002\u3002\u4e0d\u8fc7\u90a3\u5b89\u5168\u6027\u600e\u4e48\u5904\u7406\uff1f\u3002\u3002\u6240\u4ee5\u5e94\u8be5\u8fd8\u662f\u5de5\u7a0b\u5c42\u9762\u7684\u4e1c\u897f\u5427\u3002\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/gradio-app\/gradio\/tree\/main\/client\">https:\/\/github.com\/gradio-app\/gradio\/tree\/main\/client<\/a><\/li>\n<li><a href=\"https:\/\/www.tomsoderlund.com\/ai\/building-ai-powered-rest-api\">https:\/\/www.tomsoderlund.com\/ai\/building-ai-powered-rest-api<\/a><\/li>\n<\/ul>\n<h1><span class=\"ez-toc-section\" id=\"%E4%BE%8B%E5%AD%90\"><\/span>\u4f8b\u5b50<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<blockquote><p>The Gradio client works with any hosted Gradio app, whether it be an image generator, a text summarizer, a stateful chatbot, a tax calculator, or anything else! The Gradio Client is mostly used with apps hosted on Hugging Face Spaces, but your app can be hosted anywhere, such as your own server.<\/p><\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"ChatGPT\"><\/span>ChatGPT<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u9996\u5148\u6211\u4eec\u5148\u4f7f\u7528 ChatGPT \u719f\u6089\u4e00\u4e0b\u57fa\u7840\u7684 Gradio \u7a0b\u5e8f\u3002<br \/>\nHuggingFace \u4e0a ChatGPT instance \u4e0d\u8981\u592a\u591a\u3002\u3002\u3002\u8ba9\u6211\u4eec\u968f\u673a\u770b\u51e0\u4e2a\u4f8b\u5b50\u3002\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"loveleaves2012ChatGPT\"><\/span>loveleaves2012\/ChatGPT<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/huggingface.co\/spaces\/loveleaves2012\/ChatGPT\">https:\/\/huggingface.co\/spaces\/loveleaves2012\/ChatGPT<\/a><br \/>\n\u8fd9\u4e2a\u7248\u672c\u52a0\u4e86\u4e00\u70b9\u70b9 Pre-Prompt \u6765\u505a\u529f\u80fd\uff0c\u4f46\u4ee3\u7801\u4e5f\u6700\u79bb\u8c31\uff0c\u5c45\u7136\u628a OpenAI Key \u76f4\u63a5 hardcode \u5728\u4e86\u6e90\u4ee3\u7801\u91cc\uff0c\u4f46\u662f\u5176\u5b9e huggingface \u662f\u6709\u73af\u5883\u53d8\u91cf\u7684\u8bbe\u8ba1\u7684\u3002<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"ysharmaChatGPTwithAPI\"><\/span>ysharma\/ChatGPTwithAPI<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/huggingface.co\/spaces\/ysharma\/ChatGPTwithAPI\">https:\/\/huggingface.co\/spaces\/ysharma\/ChatGPTwithAPI<\/a><br \/>\n\u8fd9\u4e2a\u7248\u672c\u6bd4\u8f83\u6807\u51c6\uff0c\u8ba9\u7528\u6237\u81ea\u5df1\u586b\u81ea\u5df1\u7684 OpenAI Key\uff0c\u8fd9\u8c8c\u4f3c\u4e5f\u662f\u73b0\u5728\u8fd9\u7c7b\u5e94\u7528\u7684\u4e00\u4e2a\u6807\u51c6\u505a\u6cd5\u3002\uff08\u8ba9\u7528\u6237\u81ea\u5e26 Key \u3002\u3002\u3002\uff09<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"anzorqchatgpt-demo\"><\/span>anzorq\/chatgpt-demo<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/huggingface.co\/spaces\/anzorq\/chatgpt-demo\">https:\/\/huggingface.co\/spaces\/anzorq\/chatgpt-demo<\/a><\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u7248\u672c\u76ee\u524d\u6211\u89c9\u5f97\u6700\u68d2\u3002\u3002\u3002\u56e0\u4e3a\u5b83\u8fd8\u4ee3\u4e00\u4e2a\u7c7b\u4f3c stable diffusion \u5b89\u88c5\u63d2\u4ef6\u7684\u529f\u80fd\u3002\u3002\u4ece gist \u91cc\u540c\u6b65 prompt \u6a21\u677f\u3002\u3002\u3002<br \/>\n\u6211\u4eec\u590d\u523b\u7684\u7248\u672c\u5728 <a href=\"https:\/\/testing.agentswap.net\/models\/30\/test\">\u8fd9\u91cc<\/a>\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"ChatGLM\"><\/span>ChatGLM<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/Akegarasu\/ChatGLM-webui\">https:\/\/github.com\/Akegarasu\/ChatGLM-webui<\/a><\/li>\n<li><a href=\"https:\/\/huggingface.co\/spaces\/multimodalart\/ChatGLM-6B\">https:\/\/huggingface.co\/spaces\/multimodalart\/ChatGLM-6B<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/lychees\/ChatGLM-Gradio\">https:\/\/github.com\/lychees\/ChatGLM-Gradio<\/a><\/li>\n<\/ul>\n<p>\u5f53\u7136\u4e0a\u9762\u7684\u4f8b\u5b50\u91cc\u867d\u7136\u662f Gradio\uff0c\u4f46\u5b9e\u9645\u6700\u540e\u90fd\u662f\u7528 OpenAI \u7684\u670d\u52a1\uff0c\u5e76\u6ca1\u80fd\u5c55\u73b0 gradio_client \u7684\u4f18\u8d8a\u6027\u3002\u3002\u3002<br \/>\n\u6240\u4ee5\u6211\u4eec\u6362\u4e00\u4e2a LLM \u7684\u4f8b\u5b50\u3002\u4e0a\u9762\u662f\u4e09\u6bb5 ChatGLM \u7684\u4ee3\u7801\uff0c\u90fd\u662f\u7528 Gradio \u5b9e\u73b0\u3002<br \/>\n\u9996\u5148\u662f\u7d05\u8449\u5927\u5927\u7684\u7248\u672c\uff0c\u8fd9\u4e2a\u7248\u672c\u7684\u63a7\u4ef6\u6700\u4e30\u5bcc\uff0c\u4f46\u662f\u662f\u5b8c\u5168\u672c\u5730\u7248\uff0c\u9700\u8981\u7528\u6237\u5c06\u6a21\u578b\u4e0b\u8f7d\u5230\u672c\u5730\u65b9\u53ef\u8fd0\u884c\u3002<br \/>\n\u5e76\u4e0d\u517c\u5bb9 huggingface\u3002<\/p>\n<p>\u7b2c\u4e8c\u4e2a\u662f HF \u7684\u9ad8\u4ea7 stuff\uff0cmultimodalart \u7684\u7248\u672c\uff0c\u5229\u7528\u4e86 HF \u7684\u57fa\u7840\u8bbe\u65bd\uff0c\u4f46\u662f\u9700\u8981\u7528\u6237\u82b1\u94b1 host model \u65b9\u53ef\u8fd0\u884c\u3002<\/p>\n<pre class=\"brush: python; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\ndef predict(input, history=None):\r\n    if history is None:\r\n        history = &#x5B;]\r\n    response, history = model.chat(tokenizer, input, history)\r\n    return history, history\r\n<\/pre>\n<p>\u7b2c\u4e09\u4e2a\u7248\u672c\u662f\u6211\u4ece\u7b2c\u4e8c\u4e2a\u7248\u672c\u9b54\u6539\u800c\u6765\u7684\uff0c\u6838\u5fc3\u662f\u53ea\u9700\u8981\u4fee\u6539 predict \u51fd\u6570\uff0c\u8df3\u8fc7\u6a21\u578b\u8c03\u7528\u7684\u8fc7\u7a0b\uff0c\u800c\u76f4\u63a5\u4ece\u8fdc\u7aef\u8fdb\u884c\u547c\u53eb\u3002<\/p>\n<pre class=\"brush: python; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\ndef predict(input, history=None):\r\n    if history is None:\r\n        history = &#x5B;]\r\n\r\n    client = Client('https:\/\/multimodalart-chatglm-6b.hf.space\/')\r\n    with open(client.predict(input, fn_index=0)) as f: \r\n        text = process_text(f.read())\r\n        output = json.loads(text)&#x5B;0]\r\n        history += &#x5B;output]\r\n        return history, history\r\n<\/pre>\n<p>\u8fd9\u4e2a\u4f8b\u5b50\u76ee\u524d\u8dd1\u5728\u8fd9\u513f\uff1a<a href=\"https:\/\/testing.agentswap.net\/models\/19\/remi-test-app\">https:\/\/testing.agentswap.net\/models\/19\/remi-test-app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Stable_Diffusion_21\"><\/span>Stable Diffusion 2.1<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/huggingface.co\/stabilityai\/stable-diffusion-2-1\">https:\/\/huggingface.co\/stabilityai\/stable-diffusion-2-1<\/a><\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u4f8b\u5b50\u66f4\u590d\u6742\u4e00\u4e9b\uff0c\u9996\u5148\uff0c\u867d\u7136 host \u5728 huggingface \u4e0a\uff0c\u4f46\u5b83\u5e76\u4e0d\u662f\u4e00\u4e2a\u4f20\u7edf\u7684 huggingface service\uff0c\u800c\u662f\u66f4\u7c7b\u4f3c\u4e4b\u524d\u7684 ChatGPT \u91cc\u7684\u4f8b\u5b50\uff0c\u662f\u4e00\u4e2a\u7531 Google \u548c StabilityAI \u5171\u540c\u7ef4\u62a4\u7684\u4e00\u4e2a public good\u3002\u3002<\/p>\n<p>\u4f46\u662f\u6211\u4eec\u4f9d\u7136\u548c\u4e0a\u4f8b\u4e00\u6837\u3002\u3002\u3002\u53ef\u4ee5\u901a\u8fc7 gradio_client\u00a0\u83b7\u5f97 predict \u65b9\u6cd5\u3002\u3002\u3002<\/p>\n<p>\u53ef\u4ee5\u5728 <a href=\"https:\/\/testing.agentswap.net\/models\/26\/test\">\u8fd9\u91cc<\/a> \u770b\u5230\u5b9e\u9645\u8fd0\u884c\u7684\u7ed3\u679c\u3002<\/p>\n<h1><span class=\"ez-toc-section\" id=\"Further_Discussion\"><\/span>Further Discussion<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>gradio_client \u770b\u8d77\u6765\u7b26\u5408\u4e86\u6211\u5bf9\u5f00\u6e90\u8f6f\u4ef6\u7684\u5b8c\u7f8e\u9884\u671f\uff0c\u4eba\u4eba\u4e3a\u6211\uff0c\u6211\u4e3a\u4eba\u4eba\uff0c\u751a\u81f3\u8bf4\u6211\u53ef\u4ee5\u672c\u5730 self host\uff0c\u7136\u540e share=true\uff0c<br \/>\n\u7136\u540e\u5229\u7528 gradio_client \u518d\u6253\u5305\u6210\u5916\u90e8\u670d\u52a1\uff08\u6bd4\u5982 telegram bot\uff09\u3002\u3002\u3002\u60f3\u8c61\u7a7a\u95f4\u5f88\u5927\u3002\u3002\u3002<\/p>\n<p>\u4f46\u662f\u4ed4\u7ec6\u60f3\u60f3\uff0c\u8fd9\u91cc\u4e5f\u6709\u4e00\u4e9b\u95ee\u9898\uff0c\u6700\u5927\u7684\u53d7\u5bb3\u8005\u53ef\u80fd\u662f\u90e8\u7f72\u6a21\u578b\u7684\u90a3\u4e2a\u5b69\u5b50\uff0c\u76f8\u5f53\u4e8e\u82b1\u94b1\u7ed9\u5927\u5bb6\u505a public good\u3002<br \/>\n\u800c\u4e14\u5982\u679c\u4e00\u4efd\u6a21\u578b\u975e\u5e38\u706b\u7206\uff0c\u73b0\u6709\u7684\u67b6\u6784\u7684\u53ef\u6269\u5c55\u6027\u76f8\u4ea4\u4e8e Cloud Model \u4e5f\u4f1a\u5f88\u5feb\u663e\u793a\u51fa\u4e0d\u8db3\u3002<br \/>\n\u5f53\u7136\u73b0\u5728\u56e0\u4e3a\u8d44\u6599\u592a\u5c11\uff0c\u6211\u4f9d\u7136\u6ca1\u641e\u61c2\u5b83\u662f\u600e\u4e48\u5b9e\u73b0\u7684\uff0c\u4ee5\u53ca export \u51fa\u7684 function \u6ee1\u8db3\u4ec0\u4e48\u6837\u7684\u89c4\u5219\uff0c\u6709\u6ca1\u6709\u5b89\u5168\u6027\u98ce\u9669\u7b49\u7b49\u3002\u3002<\/p>\n<p>\u6700\u540e <a href=\"https:\/\/huggingface.co\/spaces\/gradio-client-demos\/comparing-captioning-models\">\u8fd9\u91cc<\/a> \u4f3c\u4e4e\u6709\u66f4\u591a\u7684\u4f8b\u5b50\u3002<br \/>\n\u751a\u81f3\u8fd8\u6709\u4f9d\u8d56 gradio_client \u6784\u5efa\u7684 <a href=\"https:\/\/github.com\/freddyaboulton\/gradio-tools\">gradio_tools<\/a>\u3002\u3002\u3002\u3002\u592a\u5feb\u4e86\u5427\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740\u6700\u8fd1 HuggingGPT \u548c AutoGPT \u7684\u706b\u7206\uff0c\u8ba9 LLM \u4f5c\u4e3a Control \u8c03\u7528\u5404\u79cd\u5404\u6837\u7684 Domain Expert Models \u4e5f\u6210\u4e3a\u4e86\u4e00\u4e2a\u5e38\u89c1\u7684\u9700\u6c42\u4e86\u3002 \u8fde Gradio \u4e5f\u5728\u4e0a\u5468\u63a8\u51fa\u4e86 gradio_client \u529f\u80fd\u3002 \u987a\u5e26\u4e00\u63d0\u3002\u3002\u524d\u51e0\u5929 OpenAI \u4e09\u5de8\u5934\u4e4b\u4e00\u7684 GDB \u5728 Ted \u7ed9\u4e86\u4e00\u4e2a talk\uff0c\u4e5f\u518d\u6b21\u5411\u516c\u4f17\u79c0\u4e86\u4e00\u628a ChatGPT Plugin&#8230; \u53ef\u60dc \u91cf\u5b50\u4f4d\u7684\u8fd9\u7bc7\u62a5\u9053 \u660e\u663e\u662f\u6df7\u6dc6\u4e86 AutoGPT \u548c ChatGPT Plugin&#8230; \u8c03\u6a21\u578b\u53ef\u4ee5\u7b97\u505a\u4f7f\u7528\u5de5\u5177\u7684\u4e00\u73af\uff0c\u4f46 AutoGPT \u6838\u5fc3\u7684 feature \u662f Auto \u554a\u3002 \u603b\u4e4b\uff0c\u5148\u8ba9\u6211\u4eec\u770b\u770b gradio_client \u5177\u4f53\u90fd\u80fd\u505a\u4e9b\u4ec0\u4e48\u5427~\uff01 \u80cc\u666f \u5728\u5177\u4f53\u8ba8\u8bba gradio_client \u4e4b\u524d\uff0c\u6211\u4eec\u4e0d\u59a8\u7a0d\u5fae\u56de\u987e\u4e00\u4e0b\u5f53\u524d\u5f00\u53d1\u8005\u7684\u73b0\u72b6\uff0c\u968f\u7740 ChatGPT \u7684\u706b\u7206\u548c\u5176\u6781\u5176\u5ec9\u4ef7\u7684\uff0c\u8fd1\u4e4e\u4e8e\u503e\u9500\u7684\u5b9a\u4ef7\u6a21\u5f0f\uff0c\u4f7f\u5f97 OpenAI API \u5df2\u7ecf\u51e0\u4e4e\u6210\u4e3a\u6240\u6709\u5f00\u53d1\u8005\u7684\u6807\u914d\uff0c\u751a\u81f3\u8bb8\u591a\u5f00\u53d1\u8005\u90fd\u5c06\u5f00\u6e90 LLM [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2613,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[],"class_list":["post-2587","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2023\/04\/a058-hymscpq2721937.jpeg","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-FJ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/2587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/comments?post=2587"}],"version-history":[{"count":24,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/2587\/revisions"}],"predecessor-version":[{"id":2619,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/2587\/revisions\/2619"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media\/2613"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=2587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=2587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=2587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}