{"id":7870,"date":"2023-10-06T15:05:53","date_gmt":"2023-10-06T23:05:53","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=7870"},"modified":"2025-04-24T17:05:42","modified_gmt":"2025-04-24T17:05:42","slug":"how-to-integrate-comet-with-gradio","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/","title":{"rendered":"How to Integrate Comet with Gradio"},"content":{"rendered":"\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\">\n\n\n\n<div class=\"fj fk fl fm fn\">\n<div class=\"ab ca\">\n<div class=\"ch bg ev ew ex ey\">\n<figure class=\"ms mt mu mv mw mx mp mq paragraph-image\">\n<div class=\"my mz ec na bg nb\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg nc nd c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*R0eIciTyF_R4xSZv7TlVMg.png\" alt=\"\" width=\"700\" height=\"371\"><\/figure><div class=\"mp mq mr\"><picture><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"f098\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Machine learning is a branch of artificial intelligence that gives computers the ability to learn without being explicitly programmed to do so. It is used to teach computers to do things like identify objects in photos, spot faces on security footage, and translate one language to another, among many other things.<\/p>\n<p id=\"69cc\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">One way to test if a machine learning model behaves as expected, is by using a demo interface. A demo interface can help you debug any issues that you may be having with your machine learning model. For example, you can use <a class=\"af nz\" href=\"https:\/\/gradio.app\/\" target=\"_blank\" rel=\"noopener ugc nofollow\"><strong class=\"be oa\">Gradio<\/strong><\/a>, a very popular Python library, which permits you to build a testing web interface very quickly.<\/p>\n<p id=\"bb19\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\"><strong class=\"be oa\">The good news is that you can use Gradio to interact with your <\/strong><a class=\"af nz\" href=\"https:\/\/www.comet.com\/\" target=\"_blank\" rel=\"noopener ugc nofollow\"><strong class=\"be oa\">Comet<\/strong><\/a><strong class=\"be oa\">experiments as well!<\/strong> In this article, we will go over how to build a demo interface in Gradio, and integrate it with Comet.<\/p>\n<p id=\"f384\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">The article is organized as follows:<\/p>\n<ul class=\"\">\n<li id=\"cef0\" class=\"ne nf fq be b gt ng nh ni gw nj nk nl nm ob no np nq oc ns nt nu od nw nx ny oe of og bj\" data-selectable-paragraph=\"\">Building an interface in Gradio<\/li>\n<li id=\"69b0\" class=\"ne nf fq be b gt oh nh ni gw oi nk nl nm oj no np nq ok ns nt nu ol nw nx ny oe of og bj\" data-selectable-paragraph=\"\">Displaying the Gradio interface in Comet.<\/li>\n<\/ul>\n<h1 id=\"06df\" class=\"om on fq be oo op oq gv or os ot gy ou ov ow ox oy oz pa pb pc pd pe pf pg ph bj\" data-selectable-paragraph=\"\">Building an interface in Gradio<\/h1>\n<p id=\"892b\" class=\"pw-post-body-paragraph ne nf fq be b gt pi nh ni gw pj nk nl nm pk no np nq pl ns nt nu pm nw nx ny fj bj\" data-selectable-paragraph=\"\">As an example, we will use the popular iris dataset, provided by scikit-learn, to build a K-Nearest Neighbors classification model. Then we will build a Gradio interface, which will permit you to provide new input, and use the model to predict the class label. Finally, we will track the model in Comet.<\/p>\n<p id=\"6471\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Firstly, we should import all the required libraries. Make sure to import the libraries in the correct order; the Comet library should be imported before all the other libraries:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"e839\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">from comet_ml import Experiment\nimport gradio as gr<\/span><\/pre>\n<p id=\"98f2\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Next, we define the Gradio interface (which requires three main components for our example):<\/p>\n<ul class=\"\">\n<li id=\"0b9e\" class=\"ne nf fq be b gt ng nh ni gw nj nk nl nm ob no np nq oc ns nt nu od nw nx ny oe of og bj\" data-selectable-paragraph=\"\">the inputs, which contain a number box for each feature of our dataset;<\/li>\n<li id=\"64e7\" class=\"ne nf fq be b gt oh nh ni gw oi nk nl nm oj no np nq ok ns nt nu ol nw nx ny oe of og bj\" data-selectable-paragraph=\"\">the prediction function, which parses the inputs and uses the model to predict the target label;<\/li>\n<li id=\"42d2\" class=\"ne nf fq be b gt oh nh ni gw oi nk nl nm oj no np nq ok ns nt nu ol nw nx ny oe of og bj\" data-selectable-paragraph=\"\">the outputs, which contain the target labels.<\/li>\n<\/ul>\n<p id=\"b738\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Firstly, we define the prediction function:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"8727\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">model = None\ndef <strong class=\"po ga\">predict<\/strong>(input1, input2):\n   class_names = ['setosa', 'versicolor', 'virginica']\n   prediction = model.predict_proba([[input1,input2]])\n   return {class_names[i]:\n     float(prediction[0][i]) for i in range(len(class_names))}<\/span><\/pre>\n<p id=\"f621\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">We set the model variable to <code class=\"cw pw px py po b\">None<\/code> here, as we have not yet defined the model. To make Gradio work properly with Comet, we should define the Gradio interface firstly, and then we can build the machine learning model afterwards. The <code class=\"cw pw px py po b\">predict()<\/code> function returns the prediction probability for each target class.<\/p>\n<p id=\"c6db\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Next, we define the inputs and the output of the Gradio interface:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"c783\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">inputs = [gr.inputs.Number(label='x1'),gr.inputs.Number(label='x2')]\nlabel = gr.outputs.Label()<\/span><\/pre>\n<p id=\"51cf\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">We create a new interface:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"9ed7\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">io = gr.Interface(fn = predict,inputs = inputs,outputs = label, title=\"Classification\")<\/span><span id=\"041c\" class=\"ps on fq po b ig pz pu l iz pv\" data-selectable-paragraph=\"\">io.launch(inline=False)<\/span><\/pre>\n<p id=\"b0e4\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Note here that we have also launched the interface with the option <code class=\"cw pw px py po b\">inline=False<\/code>, in order to not run the interface within the notebook.<\/p>\n<p id=\"563b\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Now, we load the iris dataset:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"6d9e\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">from sklearn.datasets import load_iris<\/span><span id=\"d835\" class=\"ps on fq po b ig pz pu l iz pv\" data-selectable-paragraph=\"\">iris = load_iris()\nX = iris.data[:, [2, 3]]\ny = iris.target<\/span><\/pre>\n<p id=\"6f79\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">We consider only two input features. In this article, we do not apply any transformation to the dataset because the focus here is to illustrate how to integrate Comet with Gradio.<\/p>\n<p id=\"9c79\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">We split the dataset into training and test sets:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"8b47\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">from sklearn.model_selection import train_test_split<\/span><span id=\"512f\" class=\"ps on fq po b ig pz pu l iz pv\" data-selectable-paragraph=\"\">X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)<\/span><\/pre>\n<p id=\"eb11\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Now, we are ready to create the Comet experiment:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"0951\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">experiment = Experiment()<\/span><\/pre>\n<p id=\"f369\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">And, the classifier:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"5bf5\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">from sklearn.neighbors import KNeighborsClassifier<\/span><span id=\"08c0\" class=\"ps on fq po b ig pz pu l iz pv\" data-selectable-paragraph=\"\">model = KNeighborsClassifier(n_neighbors=3)\nmodel.fit(X_train, y_train)<\/span><\/pre>\n<p id=\"0830\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">We log the accuracy of the model in Comet:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"c6d4\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">experiment.log_metric(\"accuracy\", model.score(X_test, y_test))<\/span><\/pre>\n<p id=\"4302\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Finally, we log the Gradio interface in Comet:<\/p>\n<pre class=\"ms mt mu mv mw pn po pp pq ax pr bj\"><span id=\"818d\" class=\"ps on fq po b ig pt pu l iz pv\" data-selectable-paragraph=\"\">io.integrate(comet_ml=experiment)<\/span><\/pre>\n<p id=\"afaa\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">The final statement above also terminates the Comet experiment, so you do not need to call the <code class=\"cw pw px py po b\">experiment.end()<\/code> method (if you are using a notebook).<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fj fk fl fm fn\">\n<div class=\"ab ca\">\n<div class=\"ch bg ev ew ex ey\">\n<blockquote class=\"qi\"><p id=\"e9af\" class=\"qj qk fq be ql qm qn qo qp qq qr ny dw\" data-selectable-paragraph=\"\">Prompt engineering plus Comet plus Gradio? What comes out is amazing AI-generated art! <a class=\"af nz\" href=\"https:\/\/www.comet.com\/site\/clipdraw-gallery-ai-art-powered-by-comet-and-gradio\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Take a closer look<\/a> at our public logging project to see some of the amazing creations that have come out of this fun experiment.<\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fj fk fl fm fn\">\n<div class=\"ab ca\">\n<div class=\"ch bg ev ew ex ey\">\n<h1 id=\"4c03\" class=\"om on fq be oo op qs gv or os qt gy ou ov qu ox oy oz qv pb pc pd qw pf pg ph bj\" data-selectable-paragraph=\"\">Showing the Gradio interface in Comet<\/h1>\n<p id=\"48b1\" class=\"pw-post-body-paragraph ne nf fq be b gt pi nh ni gw pj nk nl nm pk no np nq pl ns nt nu pm nw nx ny fj bj\" data-selectable-paragraph=\"\">To see the Gradio interface in Comet, you should create a new panel. To add the Gradio panel, you can click on Add \u2192 New Panel \u2192 PUBLIC \u2192Gradio Panel \u2192Add \u2192Done.<\/p>\n<p id=\"6e65\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">The following figure shows the added Panel:<\/p>\n<figure class=\"ms mt mu mv mw mx mp mq paragraph-image\">\n<div class=\"my mz ec na bg nb\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg nc nd c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png\" alt=\"\" width=\"700\" height=\"318\"><\/figure><div class=\"mp mq qx\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*6nDNfsF0ZP0EV6zLgXFIEQ.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div><figcaption class=\"qy qz ra mp mq rb rc be b bf z dw\" data-selectable-paragraph=\"\">Image by author<\/figcaption><\/figure>\n<p id=\"916c\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">You can select the experiment, and then insert the inputs, click on the Submit button, and then see the predicted class label, with its related probability.<\/p>\n<h1 id=\"4689\" class=\"om on fq be oo op oq gv or os ot gy ou ov ow ox oy oz pa pb pc pd pe pf pg ph bj\" data-selectable-paragraph=\"\">Summary<\/h1>\n<p id=\"831c\" class=\"pw-post-body-paragraph ne nf fq be b gt pi nh ni gw pj nk nl nm pk no np nq pl ns nt nu pm nw nx ny fj bj\" data-selectable-paragraph=\"\">Congratulations! You have just learned how to integrate Comet and Gradio!<\/p>\n<p id=\"88f9\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Using a demo interface is a great way to test your machine learning models to make sure they are behaving as expected. Additionally, demo interfaces can help you debug issues you may be having with your machine learning model. Gradio is a great option for those looking for a quick and easy way to build a testing web interface. And the good news is that you can use the Gradio interface directly in Comet!<\/p>\n<p id=\"85b0\" class=\"pw-post-body-paragraph ne nf fq be b gt ng nh ni gw nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny fj bj\" data-selectable-paragraph=\"\">Happy coding! Happy <a class=\"af nz\" href=\"http:\/\/comet.com\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Comet<\/a>!<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Machine learning is a branch of artificial intelligence that gives computers the ability to learn without being explicitly programmed to do so. It is used to teach computers to do things like identify objects in photos, spot faces on security footage, and translate one language to another, among many other things. One way to test [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","footnotes":""},"categories":[5,9],"tags":[],"coauthors":[132],"class_list":["post-7870","post","type-post","status-publish","format-standard","hentry","category-partners-integrations","category-product"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Integrate Comet with Gradio - Comet<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Integrate Comet with Gradio\" \/>\n<meta property=\"og:description\" content=\"Machine learning is a branch of artificial intelligence that gives computers the ability to learn without being explicitly programmed to do so. It is used to teach computers to do things like identify objects in photos, spot faces on security footage, and translate one language to another, among many other things. One way to test [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-06T23:05:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:05:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*R0eIciTyF_R4xSZv7TlVMg.png\" \/>\n<meta name=\"author\" content=\"Angelica Lo Duca\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Angelica Lo Duca\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Integrate Comet with Gradio - Comet","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/","og_locale":"en_US","og_type":"article","og_title":"How to Integrate Comet with Gradio","og_description":"Machine learning is a branch of artificial intelligence that gives computers the ability to learn without being explicitly programmed to do so. It is used to teach computers to do things like identify objects in photos, spot faces on security footage, and translate one language to another, among many other things. One way to test [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-10-06T23:05:53+00:00","article_modified_time":"2025-04-24T17:05:42+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*R0eIciTyF_R4xSZv7TlVMg.png","type":"","width":"","height":""}],"author":"Angelica Lo Duca","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Angelica Lo Duca","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/"},"author":{"name":"Team Comet Digital","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/6266601170c60a7a82b3e0043fbe8ddf"},"headline":"How to Integrate Comet with Gradio","datePublished":"2023-10-06T23:05:53+00:00","dateModified":"2025-04-24T17:05:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/"},"wordCount":698,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*R0eIciTyF_R4xSZv7TlVMg.png","articleSection":["Partners &amp; Integrations","Product"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/","url":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/","name":"How to Integrate Comet with Gradio - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*R0eIciTyF_R4xSZv7TlVMg.png","datePublished":"2023-10-06T23:05:53+00:00","dateModified":"2025-04-24T17:05:42+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*R0eIciTyF_R4xSZv7TlVMg.png","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*R0eIciTyF_R4xSZv7TlVMg.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/how-to-integrate-comet-with-gradio\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"How to Integrate Comet with Gradio"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/6266601170c60a7a82b3e0043fbe8ddf","name":"Team Comet Digital","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/4f0c0a8cc7c0e87c636ff6a420a6647c","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/Screen-Shot-2023-08-12-at-8.58.50-AM-96x96.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/Screen-Shot-2023-08-12-at-8.58.50-AM-96x96.png","caption":"Team Comet Digital"},"sameAs":["https:\/\/www.comet.ml\/"],"url":"https:\/\/www.comet.com\/site\/blog\/author\/teamcometdigital\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=7870"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7870\/revisions"}],"predecessor-version":[{"id":15505,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7870\/revisions\/15505"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=7870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=7870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=7870"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=7870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}