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