{"id":4905,"date":"2025-01-27T00:52:15","date_gmt":"2025-01-27T00:52:15","guid":{"rendered":"https:\/\/www.qworqs.com\/blog\/?p=4905"},"modified":"2025-01-27T00:59:48","modified_gmt":"2025-01-27T00:59:48","slug":"gradio","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2025\/01\/27\/gradio\/","title":{"rendered":"Gradio"},"content":{"rendered":"\n<p>Gradio is all about user interface, it is a startup that got acquired by Hugging Face !<\/p>\n\n\n\n<p>In your python code, you execute the following line<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import gradio as gr # The way people usually call it<\/pre>\n\n\n\n<p>now, here is an example that turns your text to uppercase<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def to_uppercase(text):<br>    return text.upper()<\/pre>\n\n\n\n<p>Now, to get a user interface, run the following code<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gr.Interface(fn=to_uppercase, inputs=\"textbox\", outputs=\"textbox\").launch()<\/pre>\n\n\n\n<p>Now, you should be getting 2 boxes, one for your input, and the other to display your text in uppercase<\/p>\n\n\n\n<p>Now, imagine the to_uppercase function being a call to an AI, so there you have it<\/p>\n\n\n\n<p>Here is a variant with big boxes<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Inputs and Outputs<br><br>view = gr.Interface(<br>    fn=to_uppercase,<br>    inputs=[gr.Textbox(label=\"Your message:\", lines=6)],<br>    # outputs=[gr.Textbox(label=\"Response:\", lines=8)],<br>    outputs=[gr.Markdown(label=\"Response:\")],<br>    flagging_mode=\"never\"<br>)<br>view.launch()<\/pre>\n\n\n\n<p>At this point, when you run this, you should get the link to the URL with that user interface !<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gradio is all about user interface, it is a startup that got acquired by Hugging Face ! In your python code, you execute the following line import gradio as gr # The way people usually call it now, here is an example that turns your text to uppercase def to_uppercase(text): return text.upper() Now, to get [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[176],"tags":[],"class_list":["post-4905","post","type-post","status-publish","format-standard","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/4905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=4905"}],"version-history":[{"count":3,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/4905\/revisions"}],"predecessor-version":[{"id":4909,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/4905\/revisions\/4909"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=4905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=4905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=4905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}