import{s as Xe,n as $e,o as Fe}from"../chunks/scheduler.d6170356.js";import{S as We,i as Re,g as n,s as l,r as Te,A as De,h as i,f as t,c as s,j as ee,u as Ce,x as r,k as ke,y as p,a as o,v as Se,d as Ae,t as Ee,w as Pe}from"../chunks/index.fcd4cc08.js";import{C as Ye}from"../chunks/CodeBlock.7b16bdef.js";import{H as Ne}from"../chunks/Heading.8660bd0e.js";function je(se){let u,R,F,D,f,Y,g,re=`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!`,N,v,pe='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:',j,b,ce='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/layout-lm-space-arxiv.gif"/>',q,y,de="We’ll cover two different ways to add your Space to ArXiv and have it show up in the Demos tab.",G,M,ue="<strong>Prerequisites</strong>",I,w,he="<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,me="<strong>Method 1 (Recommended): Linking from the Space README</strong>",z,x,fe='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>.',J,_,ge="And that’s it! Your Space should appear in the Demo tab next to the paper on ArXiv in a few minutes 🤗",U,H,ve="<strong>Method 2: Linking a Related Model</strong>",Q,T,be="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)",V,c,S,ye='<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>',te,A,Me='<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>',ae,d,E,we="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,Le='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>:',ne,C,ie,X,xe='<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>.',le,$,_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>',B,k,He="Your Space should appear in the Demo tab next to the paper on ArXiv in a few minutes 🤗",O,W,K;return f=new Ne({props:{title:"How to Add a Space to ArXiv",local:"how-to-add-a-space-to-arxiv",headingTag:"h1"}}),C=new Ye({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}}),{c(){u=n("meta"),R=l(),F=n("p"),D=l(),Te(f.$$.fragment),Y=l(),g=n("p"),g.innerHTML=re,N=l(),v=n("p"),v.innerHTML=pe,j=l(),b=n("p"),b.innerHTML=ce,q=l(),y=n("p"),y.textContent=de,G=l(),M=n("p"),M.innerHTML=ue,I=l(),w=n("ul"),w.innerHTML=he,Z=l(),L=n("p"),L.innerHTML=me,z=l(),x=n("p"),x.innerHTML=fe,J=l(),_=n("p"),_.textContent=ge,U=l(),H=n("p"),H.innerHTML=ve,Q=l(),T=n("p"),T.innerHTML=be,V=l(),c=n("ol"),S=n("li"),S.innerHTML=ye,te=l(),A=n("li"),A.innerHTML=Me,ae=l(),d=n("li"),E=n("p"),E.textContent=we,oe=l(),P=n("p"),P.innerHTML=Le,ne=l(),Te(C.$$.fragment),ie=l(),X=n("p"),X.innerHTML=xe,le=l(),$=n("li"),$.innerHTML=_e,B=l(),k=n("p"),k.textContent=He,O=l(),W=n("p"),this.h()},l(e){const a=De("svelte-u9bgzb",document.head);u=i(a,"META",{name:!0,content:!0}),a.forEach(t),R=s(e),F=i(e,"P",{}),ee(F).forEach(t),D=s(e),Ce(f.$$.fragment,e),Y=s(e),g=i(e,"P",{"data-svelte-h":!0}),r(g)!=="svelte-hgde8m"&&(g.innerHTML=re),N=s(e),v=i(e,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1g8jr89"&&(v.innerHTML=pe),j=s(e),b=i(e,"P",{"data-svelte-h":!0}),r(b)!=="svelte-1wlh2p6"&&(b.innerHTML=ce),q=s(e),y=i(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-fcz8p2"&&(y.textContent=de),G=s(e),M=i(e,"P",{"data-svelte-h":!0}),r(M)!=="svelte-zku0xa"&&(M.innerHTML=ue),I=s(e),w=i(e,"UL",{"data-svelte-h":!0}),r(w)!=="svelte-380287"&&(w.innerHTML=he),Z=s(e),L=i(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-9xghz2"&&(L.innerHTML=me),z=s(e),x=i(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-jd1fs8"&&(x.innerHTML=fe),J=s(e),_=i(e,"P",{"data-svelte-h":!0}),r(_)!=="svelte-1upyfdv"&&(_.textContent=ge),U=s(e),H=i(e,"P",{"data-svelte-h":!0}),r(H)!=="svelte-15nwmfj"&&(H.innerHTML=ve),Q=s(e),T=i(e,"P",{"data-svelte-h":!0}),r(T)!=="svelte-1eugc5q"&&(T.innerHTML=be),V=s(e),c=i(e,"OL",{});var h=ee(c);S=i(h,"LI",{"data-svelte-h":!0}),r(S)!=="svelte-pquix8"&&(S.innerHTML=ye),te=s(h),A=i(h,"LI",{"data-svelte-h":!0}),r(A)!=="svelte-1v82xo7"&&(A.innerHTML=Me),ae=s(h),d=i(h,"LI",{});var m=ee(d);E=i(m,"P",{"data-svelte-h":!0}),r(E)!=="svelte-3cwmus"&&(E.textContent=we),oe=s(m),P=i(m,"P",{"data-svelte-h":!0}),r(P)!=="svelte-hy8nia"&&(P.innerHTML=Le),ne=s(m),Ce(C.$$.fragment,m),ie=s(m),X=i(m,"P",{"data-svelte-h":!0}),r(X)!=="svelte-17yb31m"&&(X.innerHTML=xe),m.forEach(t),le=s(h),$=i(h,"LI",{"data-svelte-h":!0}),r($)!=="svelte-15ilvqm"&&($.innerHTML=_e),h.forEach(t),B=s(e),k=i(e,"P",{"data-svelte-h":!0}),r(k)!=="svelte-1re1wab"&&(k.textContent=He),O=s(e),W=i(e,"P",{}),ee(W).forEach(t),this.h()},h(){ke(u,"name","hf:doc:metadata"),ke(u,"content",qe)},m(e,a){p(document.head,u),o(e,R,a),o(e,F,a),o(e,D,a),Se(f,e,a),o(e,Y,a),o(e,g,a),o(e,N,a),o(e,v,a),o(e,j,a),o(e,b,a),o(e,q,a),o(e,y,a),o(e,G,a),o(e,M,a),o(e,I,a),o(e,w,a),o(e,Z,a),o(e,L,a),o(e,z,a),o(e,x,a),o(e,J,a),o(e,_,a),o(e,U,a),o(e,H,a),o(e,Q,a),o(e,T,a),o(e,V,a),o(e,c,a),p(c,S),p(c,te),p(c,A),p(c,ae),p(c,d),p(d,E),p(d,oe),p(d,P),p(d,ne),Se(C,d,null),p(d,ie),p(d,X),p(c,le),p(c,$),o(e,B,a),o(e,k,a),o(e,O,a),o(e,W,a),K=!0},p:$e,i(e){K||(Ae(f.$$.fragment,e),Ae(C.$$.fragment,e),K=!0)},o(e){Ee(f.$$.fragment,e),Ee(C.$$.fragment,e),K=!1},d(e){e&&(t(R),t(F),t(D),t(Y),t(g),t(N),t(v),t(j),t(b),t(q),t(y),t(G),t(M),t(I),t(w),t(Z),t(L),t(z),t(x),t(J),t(_),t(U),t(H),t(Q),t(T),t(V),t(c),t(B),t(k),t(O),t(W)),t(u),Pe(f,e),Pe(C)}}}const qe='{"title":"How to Add a Space to ArXiv","local":"how-to-add-a-space-to-arxiv","sections":[],"depth":1}';function Ge(se){return Fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ue extends We{constructor(u){super(),Re(this,u,Ge,je,Xe,{})}}export{Ue as component};
