import{s as Fe,n as We,o as Re}from"../chunks/scheduler.d6170356.js";import{S as De,i as Ye,g as n,s as o,r as pe,A as Ne,h as l,f as t,c as s,j as ae,u as ce,x as r,k as Xe,y as p,a as i,v as de,d as ue,t as he,w as me}from"../chunks/index.fcd4cc08.js";import{C as je}from"../chunks/CodeBlock.db16bf50.js";import{H as Ge,E as qe}from"../chunks/index.c1f68a2b.js";function Ie(fe){let u,D,W,Y,f,N,g,ge=`Demos on Hugging Face Spaces allow a wide audience to try out state-of-the-art machine
learning research without writing any code. <a href="https://huggingface.co/blog/arxiv" rel="nofollow">Hugging Face and ArXiv have collaborated</a>
to embed these demos directly along side papers on ArXiv!`,j,v,ve='Thanks to this integration, users can now find the most popular demos for a paper on its arXiv abstract page. For example, if you want to try out demos of the LayoutLM document classification model, you can go to <a href="https://arxiv.org/abs/1912.13318" rel="nofollow">the LayoutLM paper’s arXiv page</a>, and navigate to the demo tab. You will see open-source demos built by the machine learning community for this model, which you can try out immediately in your browser:',G,b,be='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/layout-lm-space-arxiv.gif"/>',q,y,ye="We’ll cover two different ways to add your Space to ArXiv and have it show up in the Demos tab.",I,M,Me="<strong>Prerequisites</strong>",Z,w,we="<li>There’s an existing paper on ArXiv that you’d like to create a demo for</li> <li>You have built or (can build) a demo for the model on Spaces</li>",z,L,Le="<strong>Method 1 (Recommended): Linking from the Space README</strong>",J,x,xe='The simplest way to add a Space to an ArXiv paper is to include the link to the paper in the Space README file (<code>README.md</code>). It’s good practice to include a full citation as well. You can see an example of a link and a citation on this <a href="https://huggingface.co/spaces/abidlabs/echocardiogram-arxiv/blob/main/README.md" rel="nofollow">Echocardiogram Segmentation Space README</a>.',U,_,_e="And that’s it! Your Space should appear in the Demo tab next to the paper on ArXiv in a few minutes 🤗",Q,H,He="<strong>Method 2: Linking a Related Model</strong>",V,T,Te="An alternative approach can be used to link Spaces to papers by linking an intermediate model to the Space. This requires that the paper is <strong>associated with a model</strong> that is on the Hugging Face Hub (or can be uploaded there)",B,c,A,Ce='<p>First, upload the model associated with the ArXiv paper onto the Hugging Face Hub if it is not already there. (<a href="./models-uploading">Detailed instructions are here</a>)</p>',ie,E,ke='<p>When writing the model card (README.md) for the model, include a link to the ArXiv paper. It’s good practice to include a full citation as well. You can see an example of a link and a citation on the <a href="https://huggingface.co/microsoft/layoutlm-base-uncased" rel="nofollow">LayoutLM model card</a></p> <p><em>Note</em>: you can verify this step has been carried out successfully by seeing if an ArXiv button appears above the model card. In the case of LayoutLM, the button says: “arxiv:1912.13318” and links to the LayoutLM paper on ArXiv.</p> <p><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/arxiv-button.png"/></p>',ne,d,$,Se="Then, create a demo on Spaces that loads this model. Somewhere within the code, the model name must be included in order for Hugging Face to detect that a Space is associated with it.",oe,P,Ae='For example, the <a href="https://huggingface.co/spaces/iakarshu/docformer_for_document_classification" rel="nofollow">docformer_for_document_classification</a> Space loads the LayoutLM <a href="https://huggingface.co/spaces/iakarshu/docformer_for_document_classification/blob/main/modeling.py#L484" rel="nofollow">like this</a> and include the string <code>&quot;microsoft/layoutlm-base-uncased&quot;</code>:',le,C,se,X,Ee='<em>Note</em>: Here’s an <a href="./spaces-overview">overview on building demos on Hugging Face Spaces</a> and here are more specific instructions for <a href="./spaces-sdks-gradio">Gradio</a> and <a href="./spaces-sdks-streamlit">Streamlit</a>.',re,F,$e='<p>As soon as your Space is built, Hugging Face will detect that it is associated with the model. A “Linked Models” button should appear in the top right corner of the Space, as shown here:</p> <p><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/linked-models.png"/></p> <p><em>Note</em>:  You can also add linked models manually by explicitly updating them in the <a href="https://huggingface.co/docs/hub/spaces-config-reference" rel="nofollow">README metadata for the Space, as described here</a>.</p>',O,k,Pe="Your Space should appear in the Demo tab next to the paper on ArXiv in a few minutes 🤗",K,S,ee,R,te;return f=new Ge({props:{title:"How to Add a Space to ArXiv",local:"how-to-add-a-space-to-arxiv",headingTag:"h1"}}),C=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExheW91dExNRm9yVG9rZW5DbGFzc2lmaWNhdGlvbiUwQSUwQWxheW91dGxtX2R1bW15JTIwJTNEJTIwTGF5b3V0TE1Gb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZsYXlvdXRsbS1iYXNlLXVuY2FzZWQlMjIlMkMlMjBudW1fbGFiZWxzJTNEMSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LayoutLMForTokenClassification

layoutlm_dummy = LayoutLMForTokenClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/layoutlm-base-uncased&quot;</span>, num_labels=<span class="hljs-number">1</span>)`,wrap:!1}}),S=new qe({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-add-to-arxiv.md"}}),{c(){u=n("meta"),D=o(),W=n("p"),Y=o(),pe(f.$$.fragment),N=o(),g=n("p"),g.innerHTML=ge,j=o(),v=n("p"),v.innerHTML=ve,G=o(),b=n("p"),b.innerHTML=be,q=o(),y=n("p"),y.textContent=ye,I=o(),M=n("p"),M.innerHTML=Me,Z=o(),w=n("ul"),w.innerHTML=we,z=o(),L=n("p"),L.innerHTML=Le,J=o(),x=n("p"),x.innerHTML=xe,U=o(),_=n("p"),_.textContent=_e,Q=o(),H=n("p"),H.innerHTML=He,V=o(),T=n("p"),T.innerHTML=Te,B=o(),c=n("ol"),A=n("li"),A.innerHTML=Ce,ie=o(),E=n("li"),E.innerHTML=ke,ne=o(),d=n("li"),$=n("p"),$.textContent=Se,oe=o(),P=n("p"),P.innerHTML=Ae,le=o(),pe(C.$$.fragment),se=o(),X=n("p"),X.innerHTML=Ee,re=o(),F=n("li"),F.innerHTML=$e,O=o(),k=n("p"),k.textContent=Pe,K=o(),pe(S.$$.fragment),ee=o(),R=n("p"),this.h()},l(e){const a=Ne("svelte-u9bgzb",document.head);u=l(a,"META",{name:!0,content:!0}),a.forEach(t),D=s(e),W=l(e,"P",{}),ae(W).forEach(t),Y=s(e),ce(f.$$.fragment,e),N=s(e),g=l(e,"P",{"data-svelte-h":!0}),r(g)!=="svelte-hgde8m"&&(g.innerHTML=ge),j=s(e),v=l(e,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1g8jr89"&&(v.innerHTML=ve),G=s(e),b=l(e,"P",{"data-svelte-h":!0}),r(b)!=="svelte-1wlh2p6"&&(b.innerHTML=be),q=s(e),y=l(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-fcz8p2"&&(y.textContent=ye),I=s(e),M=l(e,"P",{"data-svelte-h":!0}),r(M)!=="svelte-zku0xa"&&(M.innerHTML=Me),Z=s(e),w=l(e,"UL",{"data-svelte-h":!0}),r(w)!=="svelte-380287"&&(w.innerHTML=we),z=s(e),L=l(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-9xghz2"&&(L.innerHTML=Le),J=s(e),x=l(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-jd1fs8"&&(x.innerHTML=xe),U=s(e),_=l(e,"P",{"data-svelte-h":!0}),r(_)!=="svelte-1upyfdv"&&(_.textContent=_e),Q=s(e),H=l(e,"P",{"data-svelte-h":!0}),r(H)!=="svelte-15nwmfj"&&(H.innerHTML=He),V=s(e),T=l(e,"P",{"data-svelte-h":!0}),r(T)!=="svelte-1eugc5q"&&(T.innerHTML=Te),B=s(e),c=l(e,"OL",{});var h=ae(c);A=l(h,"LI",{"data-svelte-h":!0}),r(A)!=="svelte-pquix8"&&(A.innerHTML=Ce),ie=s(h),E=l(h,"LI",{"data-svelte-h":!0}),r(E)!=="svelte-1v82xo7"&&(E.innerHTML=ke),ne=s(h),d=l(h,"LI",{});var m=ae(d);$=l(m,"P",{"data-svelte-h":!0}),r($)!=="svelte-3cwmus"&&($.textContent=Se),oe=s(m),P=l(m,"P",{"data-svelte-h":!0}),r(P)!=="svelte-hy8nia"&&(P.innerHTML=Ae),le=s(m),ce(C.$$.fragment,m),se=s(m),X=l(m,"P",{"data-svelte-h":!0}),r(X)!=="svelte-17yb31m"&&(X.innerHTML=Ee),m.forEach(t),re=s(h),F=l(h,"LI",{"data-svelte-h":!0}),r(F)!=="svelte-15ilvqm"&&(F.innerHTML=$e),h.forEach(t),O=s(e),k=l(e,"P",{"data-svelte-h":!0}),r(k)!=="svelte-1re1wab"&&(k.textContent=Pe),K=s(e),ce(S.$$.fragment,e),ee=s(e),R=l(e,"P",{}),ae(R).forEach(t),this.h()},h(){Xe(u,"name","hf:doc:metadata"),Xe(u,"content",Ze)},m(e,a){p(document.head,u),i(e,D,a),i(e,W,a),i(e,Y,a),de(f,e,a),i(e,N,a),i(e,g,a),i(e,j,a),i(e,v,a),i(e,G,a),i(e,b,a),i(e,q,a),i(e,y,a),i(e,I,a),i(e,M,a),i(e,Z,a),i(e,w,a),i(e,z,a),i(e,L,a),i(e,J,a),i(e,x,a),i(e,U,a),i(e,_,a),i(e,Q,a),i(e,H,a),i(e,V,a),i(e,T,a),i(e,B,a),i(e,c,a),p(c,A),p(c,ie),p(c,E),p(c,ne),p(c,d),p(d,$),p(d,oe),p(d,P),p(d,le),de(C,d,null),p(d,se),p(d,X),p(c,re),p(c,F),i(e,O,a),i(e,k,a),i(e,K,a),de(S,e,a),i(e,ee,a),i(e,R,a),te=!0},p:We,i(e){te||(ue(f.$$.fragment,e),ue(C.$$.fragment,e),ue(S.$$.fragment,e),te=!0)},o(e){he(f.$$.fragment,e),he(C.$$.fragment,e),he(S.$$.fragment,e),te=!1},d(e){e&&(t(D),t(W),t(Y),t(N),t(g),t(j),t(v),t(G),t(b),t(q),t(y),t(I),t(M),t(Z),t(w),t(z),t(L),t(J),t(x),t(U),t(_),t(Q),t(H),t(V),t(T),t(B),t(c),t(O),t(k),t(K),t(ee),t(R)),t(u),me(f,e),me(C),me(S,e)}}}const Ze='{"title":"How to Add a Space to ArXiv","local":"how-to-add-a-space-to-arxiv","sections":[],"depth":1}';function ze(fe){return Re(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Be extends De{constructor(u){super(),Ye(this,u,ze,Ie,Fe,{})}}export{Be as component};
