Buckets:
| import{s as ht,o as ut,n as ct}from"../chunks/scheduler.ddb4e551.js";import{S as $t,i as bt,g as s,s as l,r as m,B as _t,h as o,f as n,c as i,j as gt,u as d,x as c,k as pt,y as vt,a,v as g,d as p,t as h,w as u}from"../chunks/index.e16e4efa.js";import{T as wt}from"../chunks/Tip.20abb04f.js";import{H as B,E as yt}from"../chunks/index.e108c5ed.js";import{I as Tt}from"../chunks/InferenceSnippet.8df18a84.js";function xt(S){let r,b='For more details about the <code>translation</code> task, check out its <a href="https://huggingface.co/tasks/translation" rel="nofollow">dedicated page</a>! You will find examples and related materials.';return{c(){r=s("p"),r.innerHTML=b},l(f){r=o(f,"P",{"data-svelte-h":!0}),c(r)!=="svelte-ly4n0c"&&(r.innerHTML=b)},m(f,E){a(f,r,E)},p:ct,d(f){f&&n(r)}}}function Pt(S){let r,b,f,E,_,U,v,at="Translation is the task of converting text from one language to another.",j,$,F,w,D,y,lt='<li><a href="https://huggingface.co/facebook/nllb-200-1.3B" rel="nofollow">facebook/nllb-200-1.3B</a>: Very powerful model that can translate many languages between each other, especially low-resource languages.</li> <li><a href="https://huggingface.co/google-t5/t5-base" rel="nofollow">google-t5/t5-base</a>: A general-purpose Transformer that can be used to translate from English to German, French, or Romanian.</li>',G,T,it='Explore all available models and find the one that suits you best <a href="https://huggingface.co/models?inference=warm&pipeline_tag=translation&sort=trending" rel="nofollow">here</a>.',Y,x,O,P,V,H,W,L,J,M,rt='<thead><tr><th align="left">Payload</th> <th align="left"></th> <th align="left"></th></tr></thead> <tbody><tr><td align="left"><strong>inputs*</strong></td> <td align="left"><em>string</em></td> <td align="left">The text to translate.</td></tr> <tr><td align="left"><strong>parameters</strong></td> <td align="left"><em>object</em></td> <td align="left"></td></tr> <tr><td align="left"><strong> src_lang</strong></td> <td align="left"><em>string</em></td> <td align="left">The source language of the text. Required for models that can translate from multiple languages.</td></tr> <tr><td align="left"><strong> tgt_lang</strong></td> <td align="left"><em>string</em></td> <td align="left">Target language to translate to. Required for models that can translate to multiple languages.</td></tr> <tr><td align="left"><strong> clean_up_tokenization_spaces</strong></td> <td align="left"><em>boolean</em></td> <td align="left">Whether to clean up the potential extra spaces in the text output.</td></tr> <tr><td align="left"><strong> truncation</strong></td> <td align="left"><em>enum</em></td> <td align="left">Possible values: do_not_truncate, longest_first, only_first, only_second.</td></tr> <tr><td align="left"><strong> generate_parameters</strong></td> <td align="left"><em>object</em></td> <td align="left">Additional parametrization of the text generation algorithm.</td></tr></tbody>',K,k,st="Some options can be configured by passing headers to the Inference API. Here are the available headers:",N,I,ot='<thead><tr><th align="left">Headers</th> <th align="left"></th> <th align="left"></th></tr></thead> <tbody><tr><td align="left"><strong>authorization</strong></td> <td align="left"><em>string</em></td> <td align="left">Authentication header in the form <code>'Bearer: hf_****'</code> when <code>hf_****</code> is a personal user access token with Inference API permission. You can generate one from <a href="https://huggingface.co/settings/tokens" rel="nofollow">your settings page</a>.</td></tr> <tr><td align="left"><strong>x-use-cache</strong></td> <td align="left"><em>boolean, default to <code>true</code></em></td> <td align="left">There is a cache layer on the inference API to speed up requests we have already seen. Most models can use those results as they are deterministic (meaning the outputs will be the same anyway). However, if you use a nondeterministic model, you can set this parameter to prevent the caching mechanism from being used, resulting in a real new query. Read more about caching <a href="../parameters#caching%5D">here</a>.</td></tr> <tr><td align="left"><strong>x-wait-for-model</strong></td> <td align="left"><em>boolean, default to <code>false</code></em></td> <td align="left">If the model is not ready, wait for it instead of receiving 503. It limits the number of requests required to get your inference done. It is advised to only set this flag to true after receiving a 503 error, as it will limit hanging in your application to known places. Read more about model availability <a href="../overview#eligibility%5D">here</a>.</td></tr></tbody>',Q,A,ft='For more information about Inference API headers, check out the parameters <a href="../parameters">guide</a>.',X,C,Z,R,mt='<thead><tr><th align="left">Body</th> <th align="left"></th> <th align="left"></th></tr></thead> <tbody><tr><td align="left"><strong>translation_text</strong></td> <td align="left"><em>string</em></td> <td align="left">The translated text.</td></tr></tbody>',tt,q,et,z,nt;return _=new B({props:{title:"Translation",local:"translation",headingTag:"h2"}}),$=new wt({props:{$$slots:{default:[xt]},$$scope:{ctx:S}}}),w=new B({props:{title:"Recommended models",local:"recommended-models",headingTag:"h3"}}),x=new B({props:{title:"Using the API",local:"using-the-api",headingTag:"h3"}}),P=new Tt({props:{pipeline:"translation",providersMapping:{"hf-inference":{modelId:"facebook/mbart-large-50-many-to-many-mmt",providerModelId:"facebook/mbart-large-50-many-to-many-mmt"}}}}),H=new B({props:{title:"API specification",local:"api-specification",headingTag:"h3"}}),L=new B({props:{title:"Request",local:"request",headingTag:"h4"}}),C=new B({props:{title:"Response",local:"response",headingTag:"h4"}}),q=new yt({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/inference-providers/tasks/translation.md"}}),{c(){r=s("meta"),b=l(),f=s("p"),E=l(),m(_.$$.fragment),U=l(),v=s("p"),v.textContent=at,j=l(),m($.$$.fragment),F=l(),m(w.$$.fragment),D=l(),y=s("ul"),y.innerHTML=lt,G=l(),T=s("p"),T.innerHTML=it,Y=l(),m(x.$$.fragment),O=l(),m(P.$$.fragment),V=l(),m(H.$$.fragment),W=l(),m(L.$$.fragment),J=l(),M=s("table"),M.innerHTML=rt,K=l(),k=s("p"),k.textContent=st,N=l(),I=s("table"),I.innerHTML=ot,Q=l(),A=s("p"),A.innerHTML=ft,X=l(),m(C.$$.fragment),Z=l(),R=s("table"),R.innerHTML=mt,tt=l(),m(q.$$.fragment),et=l(),z=s("p"),this.h()},l(t){const e=_t("svelte-u9bgzb",document.head);r=o(e,"META",{name:!0,content:!0}),e.forEach(n),b=i(t),f=o(t,"P",{}),gt(f).forEach(n),E=i(t),d(_.$$.fragment,t),U=i(t),v=o(t,"P",{"data-svelte-h":!0}),c(v)!=="svelte-1ivazf2"&&(v.textContent=at),j=i(t),d($.$$.fragment,t),F=i(t),d(w.$$.fragment,t),D=i(t),y=o(t,"UL",{"data-svelte-h":!0}),c(y)!=="svelte-e4krek"&&(y.innerHTML=lt),G=i(t),T=o(t,"P",{"data-svelte-h":!0}),c(T)!=="svelte-1rog4ai"&&(T.innerHTML=it),Y=i(t),d(x.$$.fragment,t),O=i(t),d(P.$$.fragment,t),V=i(t),d(H.$$.fragment,t),W=i(t),d(L.$$.fragment,t),J=i(t),M=o(t,"TABLE",{"data-svelte-h":!0}),c(M)!=="svelte-11b1ng3"&&(M.innerHTML=rt),K=i(t),k=o(t,"P",{"data-svelte-h":!0}),c(k)!=="svelte-xa4wks"&&(k.textContent=st),N=i(t),I=o(t,"TABLE",{"data-svelte-h":!0}),c(I)!=="svelte-2rfiu7"&&(I.innerHTML=ot),Q=i(t),A=o(t,"P",{"data-svelte-h":!0}),c(A)!=="svelte-1ps9cb1"&&(A.innerHTML=ft),X=i(t),d(C.$$.fragment,t),Z=i(t),R=o(t,"TABLE",{"data-svelte-h":!0}),c(R)!=="svelte-7rcsw2"&&(R.innerHTML=mt),tt=i(t),d(q.$$.fragment,t),et=i(t),z=o(t,"P",{}),gt(z).forEach(n),this.h()},h(){pt(r,"name","hf:doc:metadata"),pt(r,"content",Ht)},m(t,e){vt(document.head,r),a(t,b,e),a(t,f,e),a(t,E,e),g(_,t,e),a(t,U,e),a(t,v,e),a(t,j,e),g($,t,e),a(t,F,e),g(w,t,e),a(t,D,e),a(t,y,e),a(t,G,e),a(t,T,e),a(t,Y,e),g(x,t,e),a(t,O,e),g(P,t,e),a(t,V,e),g(H,t,e),a(t,W,e),g(L,t,e),a(t,J,e),a(t,M,e),a(t,K,e),a(t,k,e),a(t,N,e),a(t,I,e),a(t,Q,e),a(t,A,e),a(t,X,e),g(C,t,e),a(t,Z,e),a(t,R,e),a(t,tt,e),g(q,t,e),a(t,et,e),a(t,z,e),nt=!0},p(t,[e]){const dt={};e&2&&(dt.$$scope={dirty:e,ctx:t}),$.$set(dt)},i(t){nt||(p(_.$$.fragment,t),p($.$$.fragment,t),p(w.$$.fragment,t),p(x.$$.fragment,t),p(P.$$.fragment,t),p(H.$$.fragment,t),p(L.$$.fragment,t),p(C.$$.fragment,t),p(q.$$.fragment,t),nt=!0)},o(t){h(_.$$.fragment,t),h($.$$.fragment,t),h(w.$$.fragment,t),h(x.$$.fragment,t),h(P.$$.fragment,t),h(H.$$.fragment,t),h(L.$$.fragment,t),h(C.$$.fragment,t),h(q.$$.fragment,t),nt=!1},d(t){t&&(n(b),n(f),n(E),n(U),n(v),n(j),n(F),n(D),n(y),n(G),n(T),n(Y),n(O),n(V),n(W),n(J),n(M),n(K),n(k),n(N),n(I),n(Q),n(A),n(X),n(Z),n(R),n(tt),n(et),n(z)),n(r),u(_,t),u($,t),u(w,t),u(x,t),u(P,t),u(H,t),u(L,t),u(C,t),u(q,t)}}}const Ht='{"title":"Translation","local":"translation","sections":[{"title":"Recommended models","local":"recommended-models","sections":[],"depth":3},{"title":"Using the API","local":"using-the-api","sections":[],"depth":3},{"title":"API specification","local":"api-specification","sections":[{"title":"Request","local":"request","sections":[],"depth":4},{"title":"Response","local":"response","sections":[],"depth":4}],"depth":3}],"depth":2}';function Lt(S){return ut(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rt extends $t{constructor(r){super(),bt(this,r,Lt,Pt,ht,{})}}export{Rt as component}; | |
Xet Storage Details
- Size:
- 9.31 kB
- Xet hash:
- 2dbcb9aea448f24c40f329c96c812f3e59e648ec92a69dec5e962539a2eefe5a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.