import{s as ge,n as _e,o as be}from"../chunks/scheduler.6062bdaf.js";import{S as $e,i as Me,g as i,s as l,r as x,A as we,h as p,f as s,c as n,j as me,u as k,x as c,k as de,y as He,a,v as C,d as U,t as J,w as G}from"../chunks/index.4bca734e.js";import{C as te}from"../chunks/CodeBlock.fa01571c.js";import{H as se,E as Te}from"../chunks/EditOnGithub.74ab2baa.js";function ve(ae){let r,P,L,Z,o,E,f,le="이 튜토리얼에서는 <code>huggingface_hub</code>를 사용하여 Hub에서 모델, 데이터 세트 및 Spaces를 검색하는 방법을 배웁니다.",Q,h,X,u,ne=`<code>huggingface_hub</code> 라이브러리에는 Hub와 상호작용하기 위한 HTTP 클라이언트<a href="/docs/huggingface_hub/pr_2320/ko/package_reference/hf_api#huggingface_hub.HfApi">HfApi</a>가 포함되어 있습니다.
이를 통해, Hub에 저장된 모델, 데이터셋, 그리고 Spaces를 나열할 수 있습니다.`,z,m,R,d,ie='<a href="/docs/huggingface_hub/pr_2320/ko/package_reference/hf_api#huggingface_hub.HfApi.list_models">list_models()</a>의 출력은 Hub에 저장되어 있는 모델들을 나열한 결과입니다.',A,g,pe='마찬가지로, <a href="/docs/huggingface_hub/pr_2320/ko/package_reference/hf_api#huggingface_hub.HfApi.list_datasets">list_datasets()</a>를 사용하여 데이터 세트를 나열하고 <a href="/docs/huggingface_hub/pr_2320/ko/package_reference/hf_api#huggingface_hub.HfApi.list_spaces">list_spaces()</a>를 사용하여 Spaces를 나열할 수 있습니다.',B,_,N,b,ce=`리포지토리를 나열하는 것도 유용하지만, 검색을 필터링하고 싶을 수도 있습니다.
리스트에는 다음과 같은 여러 속성이 있습니다.`,W,$,re="<li><code>filter</code></li> <li><code>author</code></li> <li><code>search</code></li> <li>…</li>",q,M,oe=`이 매개변수 중 두 개는 직관적입니다(<code>author</code> 및 <code>search</code>). 그렇다면 <code>filter</code>는 어떤 것을 나타낼까요?
<code>filter</code>는 <code>ModelFilter</code> 객체(또는 <code>DatasetFilter</code>)를 입력으로 받습니다. 이를 이용해 필터링 하고 싶은 모델을 지정하여 인스턴스를 생성할 수 있습니다.`,F,w,fe="PyTorch로 작동되고 imagenet 데이터 세트로 훈련된, 이미지 분류를 위한 Hub의 모든 모델을 찾는 방법으로 예를 들어보겠습니다. 이 과정은 단일 [ModelFilter]를 사용하여 수행할 수 있습니다. 이때, 필터링 속성들은 ‘논리적 AND’로 결합되어, 지정한 모든 조건을 만족하는 모델만 선택됩니다.",I,H,Y,T,he="필터링하는 과정에서 모델을 정렬하고 상위 결과만 선택할 수도 있습니다. 다음 예제는 Hub에서 가장 많이 다운로드된 상위 5개 데이터 세트를 가져옵니다.",V,v,D,j,ue='Hub에서 사용 가능한 필터에 대해 살펴보려면 웹브라우저에서 <a href="https://huggingface.co/models" rel="nofollow">모델</a> 및 <a href="https://huggingface.co/datasets" rel="nofollow">데이터 세트</a> 페이지를 방문하여 일부 매개변수를 검색한 다음, URL에서 값들을 확인해보세요.',K,y,O,S,ee;return o=new se({props:{title:"Hub에서 검색하기",local:"search-the-hub",headingTag:"h1"}}),h=new se({props:{title:"리포지토리를 어떻게 나열하나요?",local:"how-to-list-repositories-",headingTag:"h2"}}),m=new te({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMEhmQXBpJTBBYXBpJTIwJTNEJTIwSGZBcGkoKSUwQW1vZGVscyUyMCUzRCUyMGFwaS5saXN0X21vZGVscygp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> HfApi
<span class="hljs-meta">&gt;&gt;&gt; </span>api = HfApi()
<span class="hljs-meta">&gt;&gt;&gt; </span>models = api.list_models()`,wrap:!1}}),_=new se({props:{title:"리포지토리를 어떻게 필터링하나요?",local:"how-to-filter-repositories-",headingTag:"h2"}}),H=new te({props:{code:"bW9kZWxzJTIwJTNEJTIwaGZfYXBpLmxpc3RfbW9kZWxzKCUwQSUyMCUyMCUyMCUyMGZpbHRlciUzRE1vZGVsRmlsdGVyKCUwQSUwOSUwOXRhc2slM0QlMjJpbWFnZS1jbGFzc2lmaWNhdGlvbiUyMiUyQyUwQSUwOSUwOWxpYnJhcnklM0QlMjJweXRvcmNoJTIyJTJDJTBBJTA5JTA5dHJhaW5lZF9kYXRhc2V0JTNEJTIyaW1hZ2VuZXQlMjIlMEElMDkpJTBBKQ==",highlighted:`models = hf_api.list_models(
    <span class="hljs-built_in">filter</span>=ModelFilter(
		task=<span class="hljs-string">&quot;image-classification&quot;</span>,
		library=<span class="hljs-string">&quot;pytorch&quot;</span>,
		trained_dataset=<span class="hljs-string">&quot;imagenet&quot;</span>
	)
)`,wrap:!1}}),v=new te({props:{code:"bGlzdChsaXN0X2RhdGFzZXRzKHNvcnQlM0QlMjJkb3dubG9hZHMlMjIlMkMlMjBkaXJlY3Rpb24lM0QtMSUyQyUyMGxpbWl0JTNENSkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(list_datasets(sort=<span class="hljs-string">&quot;downloads&quot;</span>, direction=-<span class="hljs-number">1</span>, limit=<span class="hljs-number">5</span>))
[DatasetInfo(
	<span class="hljs-built_in">id</span>=<span class="hljs-string">&#x27;argilla/databricks-dolly-15k-curated-en&#x27;</span>,
	author=<span class="hljs-string">&#x27;argilla&#x27;</span>,
	sha=<span class="hljs-string">&#x27;4dcd1dedbe148307a833c931b21ca456a1fc4281&#x27;</span>,
	last_modified=datetime.datetime(<span class="hljs-number">2023</span>, <span class="hljs-number">10</span>, <span class="hljs-number">2</span>, <span class="hljs-number">12</span>, <span class="hljs-number">32</span>, <span class="hljs-number">53</span>, tzinfo=datetime.timezone.utc),
	private=<span class="hljs-literal">False</span>,
	downloads=<span class="hljs-number">8889377</span>,
	(...)`,wrap:!1}}),y=new Te({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/ko/guides/search.md"}}),{c(){r=i("meta"),P=l(),L=i("p"),Z=l(),x(o.$$.fragment),E=l(),f=i("p"),f.innerHTML=le,Q=l(),x(h.$$.fragment),X=l(),u=i("p"),u.innerHTML=ne,z=l(),x(m.$$.fragment),R=l(),d=i("p"),d.innerHTML=ie,A=l(),g=i("p"),g.innerHTML=pe,B=l(),x(_.$$.fragment),N=l(),b=i("p"),b.textContent=ce,W=l(),$=i("ul"),$.innerHTML=re,q=l(),M=i("p"),M.innerHTML=oe,F=l(),w=i("p"),w.textContent=fe,I=l(),x(H.$$.fragment),Y=l(),T=i("p"),T.textContent=he,V=l(),x(v.$$.fragment),D=l(),j=i("p"),j.innerHTML=ue,K=l(),x(y.$$.fragment),O=l(),S=i("p"),this.h()},l(e){const t=we("svelte-u9bgzb",document.head);r=p(t,"META",{name:!0,content:!0}),t.forEach(s),P=n(e),L=p(e,"P",{}),me(L).forEach(s),Z=n(e),k(o.$$.fragment,e),E=n(e),f=p(e,"P",{"data-svelte-h":!0}),c(f)!=="svelte-le4amt"&&(f.innerHTML=le),Q=n(e),k(h.$$.fragment,e),X=n(e),u=p(e,"P",{"data-svelte-h":!0}),c(u)!=="svelte-alny60"&&(u.innerHTML=ne),z=n(e),k(m.$$.fragment,e),R=n(e),d=p(e,"P",{"data-svelte-h":!0}),c(d)!=="svelte-1b2nxpt"&&(d.innerHTML=ie),A=n(e),g=p(e,"P",{"data-svelte-h":!0}),c(g)!=="svelte-a19way"&&(g.innerHTML=pe),B=n(e),k(_.$$.fragment,e),N=n(e),b=p(e,"P",{"data-svelte-h":!0}),c(b)!=="svelte-1tvmxil"&&(b.textContent=ce),W=n(e),$=p(e,"UL",{"data-svelte-h":!0}),c($)!=="svelte-11piw8k"&&($.innerHTML=re),q=n(e),M=p(e,"P",{"data-svelte-h":!0}),c(M)!=="svelte-pz9l7h"&&(M.innerHTML=oe),F=n(e),w=p(e,"P",{"data-svelte-h":!0}),c(w)!=="svelte-1uzqvll"&&(w.textContent=fe),I=n(e),k(H.$$.fragment,e),Y=n(e),T=p(e,"P",{"data-svelte-h":!0}),c(T)!=="svelte-19mvq8d"&&(T.textContent=he),V=n(e),k(v.$$.fragment,e),D=n(e),j=p(e,"P",{"data-svelte-h":!0}),c(j)!=="svelte-1sye4bu"&&(j.innerHTML=ue),K=n(e),k(y.$$.fragment,e),O=n(e),S=p(e,"P",{}),me(S).forEach(s),this.h()},h(){de(r,"name","hf:doc:metadata"),de(r,"content",je)},m(e,t){He(document.head,r),a(e,P,t),a(e,L,t),a(e,Z,t),C(o,e,t),a(e,E,t),a(e,f,t),a(e,Q,t),C(h,e,t),a(e,X,t),a(e,u,t),a(e,z,t),C(m,e,t),a(e,R,t),a(e,d,t),a(e,A,t),a(e,g,t),a(e,B,t),C(_,e,t),a(e,N,t),a(e,b,t),a(e,W,t),a(e,$,t),a(e,q,t),a(e,M,t),a(e,F,t),a(e,w,t),a(e,I,t),C(H,e,t),a(e,Y,t),a(e,T,t),a(e,V,t),C(v,e,t),a(e,D,t),a(e,j,t),a(e,K,t),C(y,e,t),a(e,O,t),a(e,S,t),ee=!0},p:_e,i(e){ee||(U(o.$$.fragment,e),U(h.$$.fragment,e),U(m.$$.fragment,e),U(_.$$.fragment,e),U(H.$$.fragment,e),U(v.$$.fragment,e),U(y.$$.fragment,e),ee=!0)},o(e){J(o.$$.fragment,e),J(h.$$.fragment,e),J(m.$$.fragment,e),J(_.$$.fragment,e),J(H.$$.fragment,e),J(v.$$.fragment,e),J(y.$$.fragment,e),ee=!1},d(e){e&&(s(P),s(L),s(Z),s(E),s(f),s(Q),s(X),s(u),s(z),s(R),s(d),s(A),s(g),s(B),s(N),s(b),s(W),s($),s(q),s(M),s(F),s(w),s(I),s(Y),s(T),s(V),s(D),s(j),s(K),s(O),s(S)),s(r),G(o,e),G(h,e),G(m,e),G(_,e),G(H,e),G(v,e),G(y,e)}}}const je='{"title":"Hub에서 검색하기","local":"search-the-hub","sections":[{"title":"리포지토리를 어떻게 나열하나요?","local":"how-to-list-repositories-","sections":[],"depth":2},{"title":"리포지토리를 어떻게 필터링하나요?","local":"how-to-filter-repositories-","sections":[],"depth":2}],"depth":1}';function ye(ae){return be(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Je extends $e{constructor(r){super(),Me(this,r,ye,ve,ge,{})}}export{Je as component};
