import{s as Qn,f as Vn,o as $n,n as Ke}from"../chunks/scheduler.bdbef820.js";import{S as Jn,i as jn,g as i,s as n,r as p,A as Rn,h as d,f as t,c as a,j as $,u as h,x as b,k as U,y as l,a as s,v as f,d as g,t as u,w as _}from"../chunks/index.33f81d56.js";import{T as mt}from"../chunks/Tip.34194030.js";import{D as I}from"../chunks/Docstring.64554317.js";import{C as Xe}from"../chunks/CodeBlock.362b34a4.js";import{E as At}from"../chunks/ExampleCodeBlock.4f2252c6.js";import{H as w,E as In}from"../chunks/EditOnGithub.a9246e21.js";function zn(v){let r,C='bitsandbytes는 CUDA 이외의 여러 백엔드를 지원하도록 리팩터링되고 있습니다. 현재 ROCm(AMD GPU) 및 Intel CPU 구현이 성숙 단계이며, Intel XPU는 진행 중이고 Apple Silicon 지원은 Q4/Q1에 예상됩니다. 설치 지침 및 최신 백엔드 업데이트는 <a href="https://huggingface.co/docs/bitsandbytes/main/en/installation#multi-backend" rel="nofollow">이 링크</a>를 방문하세요.',c,y,M='전체 공개 전에 버그를 식별하는 데 도움이 되는 피드백을 환영합니다! 자세한 내용과 피드백은 <a href="https://huggingface.co/docs/bitsandbytes/main/en/non_cuda_backends" rel="nofollow">이 문서</a>를 확인하세요.';return{c(){r=i("p"),r.innerHTML=C,c=n(),y=i("p"),y.innerHTML=M},l(m){r=d(m,"P",{"data-svelte-h":!0}),b(r)!=="svelte-20ipaj"&&(r.innerHTML=C),c=a(m),y=d(m,"P",{"data-svelte-h":!0}),b(y)!=="svelte-1mf0s3q"&&(y.innerHTML=M)},m(m,T){s(m,r,T),s(m,c,T),s(m,y,T)},p:Ke,d(m){m&&(t(r),t(c),t(y))}}}function Fn(v){let r,C;return r=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvbk1vZGVsJTJDJTIwQ2hhbWVsZW9uQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMGNoYW1lbGVvbiUyMGNoYW1lbGVvbi03YiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBDaGFtZWxlb25Db25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBjaGFtZWxlb24tN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMENoYW1lbGVvbk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonModel, ChameleonConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a chameleon chameleon-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ChameleonConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the chameleon-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChameleonModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){p(r.$$.fragment)},l(c){h(r.$$.fragment,c)},m(c,y){f(r,c,y),C=!0},p:Ke,i(c){C||(g(r.$$.fragment,c),C=!0)},o(c){u(r.$$.fragment,c),C=!1},d(c){_(r,c)}}}function xn(v){let r,C=`Although the recipe for forward pass needs to be defined within
this function, one should call the <code>Module</code> instance afterwards
instead of this since the former takes care of running the
registered hooks while the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=C},l(c){r=d(c,"P",{"data-svelte-h":!0}),b(r)!=="svelte-rqqap8"&&(r.innerHTML=C)},m(c,y){s(c,r,y)},p:Ke,d(c){c&&t(r)}}}function Wn(v){let r,C=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=C},l(c){r=d(c,"P",{"data-svelte-h":!0}),b(r)!=="svelte-fincs2"&&(r.innerHTML=C)},m(c,y){s(c,r,y)},p:Ke,d(c){c&&t(r)}}}function Nn(v){let r,C="Example:",c,y,M;return y=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDaGFtZWxlb25Nb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybWV0YSUyRmNoYW1lbGVvbi03YiUyMiklMEFtb2RlbCUyMCUzRCUyMENoYW1lbGVvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtZXRhJTJGY2hhbWVsZW9uLTdiJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ChameleonModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;meta/chameleon-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChameleonModel.from_pretrained(<span class="hljs-string">&quot;meta/chameleon-7b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){r=i("p"),r.textContent=C,c=n(),p(y.$$.fragment)},l(m){r=d(m,"P",{"data-svelte-h":!0}),b(r)!=="svelte-11lpom8"&&(r.textContent=C),c=a(m),h(y.$$.fragment,m)},m(m,T){s(m,r,T),s(m,c,T),f(y,m,T),M=!0},p:Ke,i(m){M||(g(y.$$.fragment,m),M=!0)},o(m){u(y.$$.fragment,m),M=!1},d(m){m&&(t(r),t(c)),_(y,m)}}}function Zn(v){let r,C=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=C},l(c){r=d(c,"P",{"data-svelte-h":!0}),b(r)!=="svelte-fincs2"&&(r.innerHTML=C)},m(c,y){s(c,r,y)},p:Ke,d(c){c&&t(r)}}}function En(v){let r,C="Example:",c,y,M;return y=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvblByb2Nlc3NvciUyQyUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFtb2RlbCUyMCUzRCUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZjaGFtZWxlb24tN2IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXByb2Nlc3NvciUyMCUzRCUyMENoYW1lbGVvblByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZjaGFtZWxlb24tN2IlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySSUyMHVzZWQlMjB0byUyMGtub3clMjBhJTIwbG90JTIwYWJvdXQlMjBjb25zdGVsbGF0aW9ucyUyMHdoZW4lMjBJJTIwd2FzJTIweW91bmdlciUyQyUyMGJ1dCUyMGFzJTIwSSUyMGdyZXclMjBvbGRlciUyQyUyMEklMjBmb3Jnb3QlMjBtb3N0JTIwb2YlMjB3aGF0JTIwSSUyMGtuZXcuJTIwVGhlc2UlMjBhcmUlMjB0aGUlMjBvbmx5JTIwdHdvJTIwY29uc3RlbGxhdGlvbnMlMjB0aGF0JTIwSSUyMHJlYWxseSUyMHJlbWVtYmVyJTIwbm93LiUzQ2ltYWdlJTNFJTNDaW1hZ2UlM0VJJTIwd291bGQlMjBsaWtlJTIwZm9yJTIweW91JTIwdG8lMjB0ZWxsJTIwbWUlMjBhYm91dCUyMDMlMjBtb3JlJTIwY29uc3RlbGxhdGlvbnMlMjBhbmQlMjBnaXZlJTIwbWUlMjBhJTIwbGl0dGxlJTIwYml0JTIwb2YlMjBoaXN0b3J5JTIwYWJvdXQlMjB0aGUlMjBjb25zdGVsbGF0aW9uLiUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQoJTIyaHR0cHMlM0ElMkYlMkZuaW5lcGxhbmV0cy5vcmclMkZ3cC1jb250ZW50JTJGdXBsb2FkcyUyRjIwMjAlMkYxMiUyRnRoZS1iaWctZGlwcGVyLTEuanBnJTIyJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQWltYWdlXzIlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCglMjJodHRwcyUzQSUyRiUyRnd3dy5reGFuLmNvbSUyRndwLWNvbnRlbnQlMkZ1cGxvYWRzJTJGc2l0ZXMlMkY0MCUyRjIwMjAlMkYxMCUyRk9SSU9OLmpwZyUyMiUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEJTVCaW1hZ2UlMkMlMjBpbWFnZV8yJTVEJTJDJTIwdGV4dCUzRHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnRvKG1vZGVsLmRldmljZSUyQyUyMHRvcmNoLmJmbG9hdDE2KSUwQSUwQWdlbmVyYXRlZF9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTAwJTJDJTIwZG9fc2FtcGxlJTNERmFsc2UpJTBBcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonProcessor, ChameleonForConditionalGeneration
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChameleonForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ChameleonProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;I used to know a lot about constellations when I was younger, but as I grew older, I forgot most of what I knew. These are the only two constellations that I really remember now.&lt;image&gt;&lt;image&gt;I would like for you to tell me about 3 more constellations and give me a little bit of history about the constellation.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(<span class="hljs-string">&quot;https://nineplanets.org/wp-content/uploads/2020/12/the-big-dipper-1.jpg&quot;</span>, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_2 = Image.<span class="hljs-built_in">open</span>(requests.get(<span class="hljs-string">&quot;https://www.kxan.com/wp-content/uploads/sites/40/2020/10/ORION.jpg&quot;</span>, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=[image, image_2], text=prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(model.device, torch.bfloat16)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">100</span>, do_sample=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){r=i("p"),r.textContent=C,c=n(),p(y.$$.fragment)},l(m){r=d(m,"P",{"data-svelte-h":!0}),b(r)!=="svelte-11lpom8"&&(r.textContent=C),c=a(m),h(y.$$.fragment,m)},m(m,T){s(m,r,T),s(m,c,T),f(y,m,T),M=!0},p:Ke,i(m){M||(g(y.$$.fragment,m),M=!0)},o(m){u(y.$$.fragment,m),M=!1},d(m){m&&(t(r),t(c)),_(y,m)}}}function Gn(v){let r,C,c,y,M,m,T,Uo,ae,St='Chameleon 모델은 META AI Chameleon 팀의 논문 <a href="https://arxiv.org/abs/2405.09818v1" rel="nofollow">Chameleon: Mixed-Modal Early-Fusion Foundation Models</a>에서 제안되었습니다. Chameleon은 벡터 양자화를 사용하여 이미지를 토큰화함으로써 멀티모달 출력을 생성할 수 있는 비전-언어 모델입니다. 이 모델은 교차된 형식을 포함한 이미지와 텍스트를 입력으로 받으며, 텍스트 응답을 생성합니다. 이미지 생성 모듈은 아직 공개되지 않았습니다.',vo,se,qt="논문의 초록은 다음과 같습니다:",wo,re,Lt="<em>우리는 이미지와 텍스트를 임의의 순서로 이해하고 생성할 수 있는 early-fusion 토큰 기반의 혼합 모달(mixed-modal) 모델의 일종인 Chameleon을 소개합니다. 우리는 초기부터 안정적인 훈련 접근법, 정렬 방법, 그리고 early-fusion, 토큰 기반, 혼합 모달 설정에 맞춘 아키텍처 매개변수를 제시합니다. 이 모델들은 시각적 질문 응답, 이미지 캡션 생성, 텍스트 생성, 이미지 생성, 장문 혼합 모달 생성 등 포괄적인 작업 범위에서 평가되었습니다. Chameleon은 단일 모델에서 이미지 캡션 생성 작업에서의 최첨단 성능을 포함한 광범위하고 일반적으로 적용 가능한 능력을 보여주며, 텍스트 전용 작업에서 Llama-2를 능가하면서 Mixtral 8x7B와 Gemini-Pro와 같은 모델들 사이에서도 경쟁력을 갖추고 있습니다. 그리고 상당한 성능의 이미지 생성도 수행합니다. 또한 프롬프트나 출력에 이미지와 텍스트의 혼합 시퀀스가 포함된 새로운 장문 혼합 모달 생성 평가에서, 인간의 판단에 따르면 Gemini Pro와 GPT-4V를 포함한 훨씬 더 큰 모델의 성능과 동등하거나 이를 능가합니다. Chameleon은 완전한 멀티모달 문서의 통합 모델링에서 중요한 발전을 보여줍니다.</em>",ko,O,Dt,Qo,le,Ht='Chameleon은 이미지를 이산적인 토큰으로 변환하기 위해 벡터 양자화 모듈을 통합합니다. 이는 자기회귀 transformer를 사용한 이미지 생성을 가능하게 합니다. <a href="https://arxiv.org/abs/2405.09818v1">원본 논문</a>에서 가져왔습니다.',Vo,ie,Yt='이 모델은 <a href="https://huggingface.co/joaogante" rel="nofollow">joaogante</a>와 <a href="https://huggingface.co/RaushanTurganbay" rel="nofollow">RaushanTurganbay</a>가 기여했습니다. 원본 코드는 <a href="https://github.com/facebookresearch/chameleon" rel="nofollow">여기</a>에서 찾을 수 있습니다.',$o,de,Jo,ce,Xt="<li><p>더 정확한 결과를 위해, 배치 생성 시 <code>padding_side=&quot;left&quot;</code>를 사용하는 것을 권장합니다. 생성하기 전에 <code>processor.tokenizer.padding_side = &quot;left&quot;</code>로 설정하십시오.</p></li> <li><p>Chameleon은 안전성 정렬을 위해 튜닝되었음을 유의하십시오. 모델이 응답을 거부하는 경우, 열린 질문보다는 더 구체적으로 질문을 해보세요.</p></li> <li><p>Chameleon은 채팅 형식으로 생성하므로, 생성된 텍스트는 항상 “assistant’s turn”으로 표시됩니다. 프로세서를 호출할 때 <code>return_for_text_completion=True</code>를 전달하여 텍스트 완성 생성을 활성화할 수 있습니다.</p></li>",jo,me,Kt=`<p>[!NOTE]
Transformers에서의 Chameleon 구현은 이미지 임베딩을 병합할 위치를 나타내기 위해 특별한 이미지 토큰을 사용합니다. 특별한 이미지 토큰을 위해 새로운 토큰을 추가하지 않고 예약된 토큰 중 하나인 <code>&lt;reserved08707&gt;</code>를 사용했습니다. 올바른 생성을 위해 프롬프트에서 이미지가 임베딩될 위치에 <code>&lt;image&gt;</code>를 추가해야 합니다.</p>`,Ro,pe,Io,he,zo,fe,en="Chameleon은 게이티드(gated) 모델이므로 Hugging Face Hub에 대한 액세스 권한이 있고 토큰으로 로그인했는지 확인하세요. 다음은 모델을 로드하고 반정밀도(<code>torch.bfloat16</code>)로 추론하는 방법입니다:",Fo,ge,xo,ue,Wo,_e,on="Chameleon은 여러 이미지를 입력으로 받아들이며, 이미지들은 동일한 프롬프트에 속하거나 다른 프롬프트에 속할 수 있습니다(배치 추론에서). 다음은 그 방법입니다:",No,be,Zo,ye,Eo,Ce,Go,Me,tn="모델은 8비트 또는 4비트로 로드할 수 있으며, 이는 원본 모델의 성능을 유지하면서 메모리 요구 사항을 크게 줄여줍니다. 먼저 bitsandbytes를 설치하고(<code>pip install bitsandbytes</code>), 라이브러리가 지원하는 GPU/가속기를 사용 중인지 확인하십시오.",Bo,P,Oo,Te,nn="위의 코드 스니펫을 다음과 같이 변경하면 됩니다:",Po,Ue,Ao,ve,So,we,an='이 모델은 최적화를 위해 Flash-Attention 2와 PyTorch의 <a href="https://pytorch.org/docs/master/generated/torch.nn.functional.scaled_dot_product_attention.html" rel="nofollow"><code>torch.nn.functional.scaled_dot_product_attention</code></a>를 모두 지원합니다. SDPA는 모델을 로드할 때 기본 옵션입니다. Flash Attention 2로 전환하려면 먼저 flash-attn을 설치해야 합니다. 해당 패키지 설치에 대해서는 <a href="https://github.com/Dao-AILab/flash-attention" rel="nofollow">원본 리포지토리</a>를 참고하십시오. 위의 코드 스니펫을 다음과 같이 변경하면 됩니다:',qo,ke,Lo,Qe,Do,J,Ve,pt,eo,sn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonModel">ChameleonModel</a>. It is used to instantiate a
chameleon model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
<a href="https://huggingface.co/meta/chameleon-7B" rel="nofollow">meta/chameleon-7B</a>.`,ht,oo,rn=`Configuration objects inherit from <a href="/docs/transformers/pr_22105/ko/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_22105/ko/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,ft,A,Ho,$e,Yo,G,Je,gt,to,ln=`This is the configuration class to store the configuration of a <code>ChameleonVQModel</code>. It is used to instantiate a
<code>ChameleonVQModel</code> according to the specified arguments, defining the model architecture.
Configuration objects inherit from <a href="/docs/transformers/pr_22105/ko/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_22105/ko/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information. Instantiating a
configuration with the defaults will yield a similar configuration to the VQModel of the
<a href="https://huggingface.co/meta/chameleon-7B" rel="nofollow">meta/chameleon-7B</a>.`,Xo,je,Ko,k,Re,ut,no,dn=`Constructs a Chameleon processor which wraps a Chameleon image processor and a Chameleon tokenizer into a single
processor.`,_t,ao,cn=`<a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonProcessor">ChameleonProcessor</a> offers all the functionalities of <a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonImageProcessor">ChameleonImageProcessor</a> and <a href="/docs/transformers/pr_22105/ko/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>.
See the <code>__call__()</code> and <a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonProcessor.decode">decode()</a> for more information.`,bt,S,Ie,yt,so,mn=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,Ct,q,ze,Mt,ro,pn=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,et,Fe,ot,W,xe,Tt,lo,hn="Constructs a Chameleon image processor.",Ut,L,We,vt,io,fn="Preprocess an image or batch of images.",tt,Ne,nt,Q,Ze,wt,co,gn=`The VQ-VAE model used in Chameleon for encoding/decoding images into discrete tokens.
This model follows the “Make-a-scene: Scene-based text-to-image generation with human priors” paper from
<a href="https://arxiv.org/abs/2203.13131" rel="nofollow">Oran Gafni, Adam Polyak, Oron Ashual, Shelly Sheynin, Devi Parikh, and Yaniv Taigman</a>.`,kt,mo,un=`This model inherits from <a href="/docs/transformers/pr_22105/ko/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Qt,po,_n=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Vt,z,Ee,$t,ho,bn="Define the computation performed at every call.",Jt,fo,yn="Should be overridden by all subclasses.",jt,D,at,Ge,st,V,Be,Rt,go,Cn=`The bare chameleon Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/pr_22105/ko/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,It,uo,Mn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,zt,_o,Tn="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>ChameleonDecoderLayer</code>",Ft,F,Oe,xt,bo,Un='The <a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonModel">ChameleonModel</a> forward method, overrides the <code>__call__</code> special method.',Wt,H,Nt,Y,rt,Pe,lt,j,Ae,Zt,yo,vn=`Chameleon Model with a head on top used for outputting logits for next token prediction.
This model inherits from <a href="/docs/transformers/pr_22105/ko/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Et,Co,wn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Gt,x,Se,Bt,Mo,kn='The <a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonForConditionalGeneration">ChameleonForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',Ot,X,Pt,K,it,qe,dt,To,ct;return M=new w({props:{title:"Chameleon",local:"chameleon",headingTag:"h1"}}),T=new w({props:{title:"개요",local:"overview",headingTag:"h2"}}),de=new w({props:{title:"사용 팁",local:"usage-tips",headingTag:"h2"}}),pe=new w({props:{title:"사용 예제",local:"usage-example",headingTag:"h2"}}),he=new w({props:{title:"단일 이미지 추론",local:"single-image-inference",headingTag:"h3"}}),ge=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvblByb2Nlc3NvciUyQyUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBDaGFtZWxlb25Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGY2hhbWVsZW9uLTdiJTIyKSUwQW1vZGVsJTIwJTNEJTIwQ2hhbWVsZW9uRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmNoYW1lbGVvbi03YiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMjBkZXZpY2VfbWFwJTNEJTIyY3VkYSUyMiklMEElMEElMjMlMjAlRUMlOUQlQjQlRUIlQUYlQjglRUMlQTclODAlRUMlOTklODAlMjAlRUQlODUlOEQlRUMlOEElQTQlRUQlOEElQjglMjAlRUQlOTQlODQlRUIlQTElQUMlRUQlOTQlODQlRUQlOEElQjglMjAlRUMlQTQlODAlRUIlQjklODQlMEF1cmwlMjAlM0QlMjAnaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyclMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEFwcm9tcHQlMjAlM0QlMjAlMjIlRUMlOUQlQjQlMjAlRUMlOUQlQjQlRUIlQUYlQjglRUMlQTclODAlRUMlOTclOTAlRUMlODQlOUMlMjAlRUIlQUMlQjQlRUMlOTclODclRUMlOUQlODQlMjAlRUIlQjMlQjQlRUIlODIlOTglRUMlOUElOTQlM0YlM0NpbWFnZSUzRSUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHRleHQlM0Rwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byhtb2RlbC5kZXZpY2UlMkMlMjBkdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQSUwQSUyMyUyMCVFRCU5NCU4NCVFQiVBMSVBQyVFRCU5NCU4NCVFRCU4QSVCOCVFQiVBNSVCQyUyMCVFQyU5RSU5MCVFQSVCOCVCMCVFRCU5QSU4QyVFQSVCNyU4MCVFQyVBMCU4MSVFQyU5QyVCQyVFQiVBMSU5QyUyMCVFQyU5OSU4NCVFQyU4NCVCMSUwQW91dHB1dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWF4X25ld190b2tlbnMlM0Q1MCklMEFwcmludChwcm9jZXNzb3IuZGVjb2RlKG91dHB1dCU1QjAlNUQlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSkp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonProcessor, ChameleonForConditionalGeneration
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> requests

processor = ChameleonProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>)
model = ChameleonForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>, torch_dtype=torch.bfloat16, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># 이미지와 텍스트 프롬프트 준비</span>
url = <span class="hljs-string">&#x27;http://images.cocodataset.org/val2017/000000039769.jpg&#x27;</span>
image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
prompt = <span class="hljs-string">&quot;이 이미지에서 무엇을 보나요?&lt;image&gt;&quot;</span>

inputs = processor(images=image, text=prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(model.device, dtype=torch.bfloat16)

<span class="hljs-comment"># 프롬프트를 자기회귀적으로 완성</span>
output = model.generate(**inputs, max_new_tokens=<span class="hljs-number">50</span>)
<span class="hljs-built_in">print</span>(processor.decode(output[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))`,wrap:!1}}),ue=new w({props:{title:"다중 이미지 추론",local:"multi-image-inference",headingTag:"h3"}}),be=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvblByb2Nlc3NvciUyQyUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBDaGFtZWxlb25Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGY2hhbWVsZW9uLTdiJTIyKSUwQSUwQW1vZGVsJTIwJTNEJTIwQ2hhbWVsZW9uRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmNoYW1lbGVvbi03YiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMjBkZXZpY2VfbWFwJTNEJTIyY3VkYSUyMiklMEElMEElMjMlMjAlRUMlODQlQjglMjAlRUElQjAlODAlRUMlQTclODAlMjAlRUIlOEIlQTQlRUIlQTUlQjglMjAlRUMlOUQlQjQlRUIlQUYlQjglRUMlQTclODAlMjAlRUElQjAlODAlRUMlQTAlQjglRUMlOTglQTQlRUElQjglQjAlMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnd3dy5pbGFua2VsbWFuLm9yZyUyRnN0b3BzaWducyUyRmF1c3RyYWxpYS5qcGclMjIlMEFpbWFnZV9zdG9wJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZV9jYXRzJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZtaWNyb3NvZnQlMkZrb3Ntb3MtMi1wYXRjaDE0LTIyNCUyRnJlc29sdmUlMkZtYWluJTJGc25vd21hbi5qcGclMjIlMEFpbWFnZV9zbm93bWFuJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQSUyMyUyMCVFQiVCMCVCMCVFQyVCOSU5OCVFQiU5MCU5QyUyMCVFRCU5NCU4NCVFQiVBMSVBQyVFRCU5NCU4NCVFRCU4QSVCOCUyMCVFQyVBNCU4MCVFQiVCOSU4NCUzQSUyMCVFQyVCMiVBQiUyMCVFQiVCMiU4OCVFQyVBNyVCOCVFQiU4QSU5NCUyMCVFQiU4QiVBNCVFQyVBNCU5MSUyMCVFQyU5RCVCNCVFQiVBRiVCOCVFQyVBNyU4MCUyMCVFRCU5NCU4NCVFQiVBMSVBQyVFRCU5NCU4NCVFRCU4QSVCOCVFQyU5RCVCNCVFQSVCMyVBMCUyMCVFQiU5MSU5MCUyMCVFQiVCMiU4OCVFQyVBNyVCOCVFQiU4QSU5NCUyMCVFQiU4QiVBOCVFQyU5RCVCQyUyMCVFQyU5RCVCNCVFQiVBRiVCOCVFQyVBNyU4MCUyMCVFRCU5NCU4NCVFQiVBMSVBQyVFRCU5NCU4NCVFRCU4QSVCOCVFQyU5RSU4NSVFQiU4QiU4OCVFQiU4QiVBNCUwQXByb21wdHMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjIlRUMlOUQlQjQlMjAlRUMlOUQlQjQlRUIlQUYlQjglRUMlQTclODAlRUIlOTMlQTQlRUMlOUQlODAlMjAlRUIlQUMlQjQlRUMlOTclODclRUMlOUQlQjQlMjAlRUElQjMlQjUlRUQlODYlQjUlRUMlQTAlOTAlRUMlOUQlQjglRUElQjAlODAlRUMlOUElOTQlM0YlM0NpbWFnZSUzRSUzQ2ltYWdlJTNFJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyJTNDaW1hZ2UlM0UlRUMlOUQlQjQlMjAlRUMlOUQlQjQlRUIlQUYlQjglRUMlQTclODAlRUMlOTclOTAlMjAlRUIlQUMlQjQlRUMlOTclODclRUMlOUQlQjQlMjAlRUIlODIlOTglRUQlODMlODAlRUIlODIlOTglMjAlRUMlOUUlODglRUIlODIlOTglRUMlOUElOTQlM0YlMjIlMEElNUQlMEElMEElMjMlMjAlRUMlOUQlQjQlRUIlQUYlQjglRUMlQTclODAlRUIlOTMlQTQlRUMlOUQlODQlMjAlRUQlODUlOEQlRUMlOEElQTQlRUQlOEElQjglMjAlRUQlOTQlODQlRUIlQTElQUMlRUQlOTQlODQlRUQlOEElQjglRUMlOTclOTAlRUMlODQlOUMlMjAlRUMlODIlQUMlRUMlOUElQTklRUIlOTAlOTglRUMlOTYlQjQlRUMlOTUlQkMlMjAlRUQlOTUlOTglRUIlOEElOTQlMjAlRUMlODglOUMlRUMlODQlOUMlRUIlOEMlODAlRUIlQTElOUMlMjAlRUMlOUUlODUlRUIlQTAlQTUlRUQlOTUlQTAlMjAlRUMlODglOTglMjAlRUMlOUUlODglRUMlOEElQjUlRUIlOEIlODglRUIlOEIlQTQlMEElMjMlMjAlRUElQjAlODElMjAlMjIlM0NpbWFnZSUzRSUyMiUyMCVFRCU4NiVBMCVFRCU4MSVCMCVFQyU5RCU4MCUyMCVFRCU5NSU5OCVFQiU4MiU5OCVFQyU5RCU5OCUyMCVFQyU5RCVCNCVFQiVBRiVCOCVFQyVBNyU4MCVFQiVBNSVCQyUyMCVFQyU4MiVBQyVFQyU5QSVBOSVFRCU5NSU5OCVFQiVBOSVCMCUyQyUyMCVFQiU4QiVBNCVFQyU5RCU4QyUyMCUyMiUzQ2ltYWdlJTNFJTIyJTIwJUVEJTg2JUEwJUVEJTgxJUIwJUVDJTlEJTgwJTIwJUVCJThCJUE0JUVDJTlEJThDJTIwJUVDJTlEJUI0JUVCJUFGJUI4JUVDJUE3JTgwJUVCJUE1JUJDJTIwJUVDJTgyJUFDJUVDJTlBJUE5JUVEJTk1JUE5JUVCJThCJTg4JUVCJThCJUE0JTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRCU1QmltYWdlX3N0b3AlMkMlMjBpbWFnZV9jYXRzJTJDJTIwaW1hZ2Vfc25vd21hbiU1RCUyQyUyMHRleHQlM0Rwcm9tcHRzJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byhkZXZpY2UlM0QlMjJjdWRhJTIyJTJDJTIwZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEElMEElMjMlMjAlRUMlODMlOUQlRUMlODQlQjElMEFnZW5lcmF0ZV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMG1heF9uZXdfdG9rZW5zJTNENTApJTBBcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonProcessor, ChameleonForConditionalGeneration
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> requests

processor = ChameleonProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>)

model = ChameleonForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>, torch_dtype=torch.bfloat16, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># 세 가지 다른 이미지 가져오기</span>
url = <span class="hljs-string">&quot;https://www.ilankelman.org/stopsigns/australia.jpg&quot;</span>
image_stop = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
image_cats = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

url = <span class="hljs-string">&quot;https://huggingface.co/microsoft/kosmos-2-patch14-224/resolve/main/snowman.jpg&quot;</span>
image_snowman = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-comment"># 배치된 프롬프트 준비: 첫 번째는 다중 이미지 프롬프트이고 두 번째는 단일 이미지 프롬프트입니다</span>
prompts = [
    <span class="hljs-string">&quot;이 이미지들은 무엇이 공통점인가요?&lt;image&gt;&lt;image&gt;&quot;</span>,
    <span class="hljs-string">&quot;&lt;image&gt;이 이미지에 무엇이 나타나 있나요?&quot;</span>
]

<span class="hljs-comment"># 이미지들을 텍스트 프롬프트에서 사용되어야 하는 순서대로 입력할 수 있습니다</span>
<span class="hljs-comment"># 각 &quot;&lt;image&gt;&quot; 토큰은 하나의 이미지를 사용하며, 다음 &quot;&lt;image&gt;&quot; 토큰은 다음 이미지를 사용합니다</span>
inputs = processor(images=[image_stop, image_cats, image_snowman], text=prompts, padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device=<span class="hljs-string">&quot;cuda&quot;</span>, dtype=torch.bfloat16)

<span class="hljs-comment"># 생성</span>
generate_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">50</span>)
processor.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)`,wrap:!1}}),ye=new w({props:{title:"모델 최적화",local:"model-optimization",headingTag:"h2"}}),Ce=new w({props:{title:"Bitsandbytes를 사용한 양자화",local:"quantization-using-bitsandbytes",headingTag:"h3"}}),P=new mt({props:{$$slots:{default:[zn]},$$scope:{ctx:v}}}),Ue=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUyQyUyMEJpdHNBbmRCeXRlc0NvbmZpZyUwQSUwQSUyMyUyMCVFQiVBQSVBOCVFQiU4RCVCOCUyMCVFQyU5NiU5MSVFQyU5RSU5MCVFRCU5OSU5NCUyMCVFQiVCMCVBOSVFQyU4QiU5RCUyMCVFQyVBNyU4MCVFQyVBMCU5NSUwQXF1YW50aXphdGlvbl9jb25maWclMjAlM0QlMjBCaXRzQW5kQnl0ZXNDb25maWcoJTBBJTIwJTIwJTIwJTIwbG9hZF9pbl80Yml0JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGJuYl80Yml0X3F1YW50X3R5cGUlM0QlMjJuZjQlMjIlMkMlMEElMjAlMjAlMjAlMjBibmJfNGJpdF9jb21wdXRlX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMEEpJTBBJTBBbW9kZWwlMjAlM0QlMjBDaGFtZWxlb25Gb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGY2hhbWVsZW9uLTdiJTIyJTJDJTIwcXVhbnRpemF0aW9uX2NvbmZpZyUzRHF1YW50aXphdGlvbl9jb25maWclMkMlMjBkZXZpY2VfbWFwJTNEJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonForConditionalGeneration, BitsAndBytesConfig

<span class="hljs-comment"># 모델 양자화 방식 지정</span>
quantization_config = BitsAndBytesConfig(
    load_in_4bit=<span class="hljs-literal">True</span>,
    bnb_4bit_quant_type=<span class="hljs-string">&quot;nf4&quot;</span>,
    bnb_4bit_compute_dtype=torch.bfloat16,
)

model = ChameleonForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>, quantization_config=quantization_config, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),ve=new w({props:{title:"Flash-Attention 2와 SDPA를 사용하여 생성 속도 향상",local:"use-flash-attention-2-and-sdpa-to-further-speed-up-generation",headingTag:"h3"}}),ke=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyZmFjZWJvb2slMkZjaGFtZWxlb24tN2IlMjIlMEFtb2RlbCUyMCUzRCUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwbG93X2NwdV9tZW1fdXNhZ2UlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwYXR0bl9pbXBsZW1lbnRhdGlvbiUzRCUyMmZsYXNoX2F0dGVudGlvbl8yJTIyJTBBKS50bygwKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonForConditionalGeneration

model_id = <span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>
model = ChameleonForConditionalGeneration.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=<span class="hljs-literal">True</span>,
    attn_implementation=<span class="hljs-string">&quot;flash_attention_2&quot;</span>
).to(<span class="hljs-number">0</span>)`,wrap:!1}}),Qe=new w({props:{title:"ChameleonConfig",local:"transformers.ChameleonConfig ][ transformers.ChameleonConfig",headingTag:"h2"}}),Ve=new I({props:{name:"class transformers.ChameleonConfig",anchor:"transformers.ChameleonConfig",parameters:[{name:"vocab_size",val:" = 65536"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 11008"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"num_key_value_heads",val:" = 32"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 4096"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-05"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = None"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_theta",val:" = 10000.0"},{name:"rope_scaling",val:" = None"},{name:"attention_bias",val:" = False"},{name:"attention_dropout",val:" = 0.0"},{name:"model_parallel_size",val:" = 1"},{name:"swin_norm",val:" = False"},{name:"vq_config",val:" = None"},{name:"vocabulary_map",val:" = None"},{name:"mlp_bias",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChameleonConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 65536) &#x2014;
Vocabulary size of the chameleon model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonModel">ChameleonModel</a>; this includes text and image tokens.`,name:"vocab_size"},{anchor:"transformers.ChameleonConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.ChameleonConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 11008) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.ChameleonConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.ChameleonConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.ChameleonConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed by meanpooling all the original heads within that group. For more details checkout [this paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to </code>num_attention_heads\`.`,name:"num_key_value_heads"},{anchor:"transformers.ChameleonConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.ChameleonConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
The maximum sequence length that this model might ever be used with. Chameleon supports up to 4096 tokens.`,name:"max_position_embeddings"},{anchor:"transformers.ChameleonConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.ChameleonConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.ChameleonConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.ChameleonConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.ChameleonConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.ChameleonConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.ChameleonConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings"},{anchor:"transformers.ChameleonConfig.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, <em>optional</em>, defaults to 10000.0) &#x2014;
The base period of the RoPE embeddings.`,name:"rope_theta"},{anchor:"transformers.ChameleonConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
<code>{&quot;type&quot;: strategy name, &quot;factor&quot;: scaling factor}</code>. When using this flag, don&#x2019;t update
<code>max_position_embeddings</code> to the expected new maximum. See the following thread for more information on how
these scaling strategies behave:
<a href="https://www.reddit.com/r/Localchameleon/comments/14mrgpr/dynamically_scaled_rope_further_increases/" rel="nofollow">https://www.reddit.com/r/Localchameleon/comments/14mrgpr/dynamically_scaled_rope_further_increases/</a>. This is an
experimental feature, subject to breaking API changes in future versions.`,name:"rope_scaling"},{anchor:"transformers.ChameleonConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, defaults to <code>False</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in the query, key, value and output projection layers during self-attention.`,name:"attention_bias"},{anchor:"transformers.ChameleonConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.ChameleonConfig.model_parallel_size",description:`<strong>model_parallel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of shards used when training the model. This will be used in qk layernorm because the original Chameleon inference
doesn&#x2019;t do reduction in those layers and each rank has its own biases.`,name:"model_parallel_size"},{anchor:"transformers.ChameleonConfig.swin_norm",description:`<strong>swin_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Use Swin Transformer normalization.`,name:"swin_norm"},{anchor:"transformers.ChameleonConfig.vq_config",description:`<strong>vq_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
ChameleonVQConfig instance containing the configuration for the VQ-VAE model.`,name:"vq_config"},{anchor:"transformers.ChameleonConfig.vocabulary_map",description:`<strong>vocabulary_map</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A dictionary containing the vocabulary map from the tokenizer. Used to obtain tokens from the image inputs.`,name:"vocabulary_map"},{anchor:"transformers.ChameleonConfig.mlp_bias",description:`<strong>mlp_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in up_proj, down_proj and gate_proj layers in the MLP layers.`,name:"mlp_bias"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/configuration_chameleon.py#L100"}}),A=new At({props:{anchor:"transformers.ChameleonConfig.example",$$slots:{default:[Fn]},$$scope:{ctx:v}}}),$e=new w({props:{title:"ChameleonVQVAEConfig",local:"transformers.ChameleonVQVAEConfig ][ transformers.ChameleonVQVAEConfig",headingTag:"h2"}}),Je=new I({props:{name:"class transformers.ChameleonVQVAEConfig",anchor:"transformers.ChameleonVQVAEConfig",parameters:[{name:"embed_dim",val:": int = 256"},{name:"num_embeddings",val:": int = 8192"},{name:"double_latent",val:": bool = False"},{name:"latent_channels",val:": int = 256"},{name:"resolution",val:": int = 512"},{name:"in_channels",val:": int = 3"},{name:"base_channels",val:": int = 128"},{name:"channel_multiplier",val:": typing.List[int] = [1, 1, 2, 2, 4]"},{name:"num_res_blocks",val:": int = 2"},{name:"attn_resolutions",val:": typing.List[int] = None"},{name:"dropout",val:": float = 0.0"},{name:"attn_type",val:": str = 'vanilla'"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChameleonVQVAEConfig.embed_dim",description:`<strong>embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of each embedding vector.`,name:"embed_dim"},{anchor:"transformers.ChameleonVQVAEConfig.num_embeddings",description:`<strong>num_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
Number of codebook embeddings.`,name:"num_embeddings"},{anchor:"transformers.ChameleonVQVAEConfig.double_latent",description:`<strong>double_latent</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use double z channels.`,name:"double_latent"},{anchor:"transformers.ChameleonVQVAEConfig.latent_channels",description:`<strong>latent_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Number of channels for the latent space.`,name:"latent_channels"},{anchor:"transformers.ChameleonVQVAEConfig.resolution",description:`<strong>resolution</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Resolution of the input images.`,name:"resolution"},{anchor:"transformers.ChameleonVQVAEConfig.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of input channels.`,name:"in_channels"},{anchor:"transformers.ChameleonVQVAEConfig.base_channels",description:`<strong>base_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Base channel count.`,name:"base_channels"},{anchor:"transformers.ChameleonVQVAEConfig.channel_multiplier",description:`<strong>channel_multiplier</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 1, 2, 2, 4]</code>) &#x2014;
Channel multipliers for each resolution.`,name:"channel_multiplier"},{anchor:"transformers.ChameleonVQVAEConfig.num_res_blocks",description:`<strong>num_res_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of residual blocks.`,name:"num_res_blocks"},{anchor:"transformers.ChameleonVQVAEConfig.attn_resolutions",description:`<strong>attn_resolutions</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Resolutions to apply attention.`,name:"attn_resolutions"},{anchor:"transformers.ChameleonVQVAEConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Dropout rate.`,name:"dropout"},{anchor:"transformers.ChameleonVQVAEConfig.attn_type",description:`<strong>attn_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;vanilla&quot;</code>) &#x2014;
Attention type used in VQ-GAN encoder. Can be &#x201C;vanilla&#x201D; or None.`,name:"attn_type"},{anchor:"transformers.ChameleonVQVAEConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/configuration_chameleon.py#L26"}}),je=new w({props:{title:"ChameleonProcessor",local:"transformers.ChameleonProcessor ][ transformers.ChameleonProcessor",headingTag:"h2"}}),Re=new I({props:{name:"class transformers.ChameleonProcessor",anchor:"transformers.ChameleonProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""},{name:"image_seq_length",val:": int = 1024"},{name:"image_token",val:": str = '<image>'"}],parametersDescription:[{anchor:"transformers.ChameleonProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonImageProcessor">ChameleonImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.ChameleonProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/pr_22105/ko/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.ChameleonProcessor.image_seq_length",description:`<strong>image_seq_length</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Sequence length of one image embedding.`,name:"image_seq_length"},{anchor:"transformers.ChameleonProcessor.image_token",description:`<strong>image_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;image&gt;&quot;</code>) &#x2014;
The special token used to indicate image in the text.`,name:"image_token"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/processing_chameleon.py#L44"}}),Ie=new I({props:{name:"batch_decode",anchor:"transformers.ChameleonProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/processing_chameleon.py#L150"}}),ze=new I({props:{name:"decode",anchor:"transformers.ChameleonProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/processing_chameleon.py#L158"}}),Fe=new w({props:{title:"ChameleonImageProcessor",local:"transformers.ChameleonImageProcessor ][ transformers.ChameleonImageProcessor",headingTag:"h2"}}),xe=new I({props:{name:"class transformers.ChameleonImageProcessor",anchor:"transformers.ChameleonImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = 1"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.0078"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChameleonImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.ChameleonImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 512}</code>):
Size of the image after resizing. The shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio. Can be overridden by <code>size</code> in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.ChameleonImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to 1) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.ChameleonImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.ChameleonImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to {&#x201C;height&#x201D; &#x2014; 512, &#x201C;width&#x201D;: 512}):
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.ChameleonImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.ChameleonImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to 0.0078) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by <code>rescale_factor</code> in the <code>preprocess</code>
method.`,name:"rescale_factor"},{anchor:"transformers.ChameleonImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.ChameleonImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[1.0, 1.0, 1.0]</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.ChameleonImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[1.0, 1.0, 1.0]</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.ChameleonImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/image_processing_chameleon.py#L70"}}),We=new I({props:{name:"preprocess",anchor:"transformers.ChameleonImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": int = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"}],parametersDescription:[{anchor:"transformers.ChameleonImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ChameleonImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.ChameleonImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.ChameleonImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ChameleonImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ChameleonImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.ChameleonImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.ChameleonImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.ChameleonImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.ChameleonImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/image_processing_chameleon.py#L194"}}),Ne=new w({props:{title:"ChameleonVQVAE",local:"transformers.ChameleonVQVAE ][ transformers.ChameleonVQVAE",headingTag:"h2"}}),Ze=new I({props:{name:"class transformers.ChameleonVQVAE",anchor:"transformers.ChameleonVQVAE",parameters:[{name:"config",val:": ChameleonVQVAEConfig"}],parametersDescription:[{anchor:"transformers.ChameleonVQVAE.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonVQVAEConfig">ChameleonVQVAEConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_22105/ko/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/modeling_chameleon.py#L991"}}),Ee=new I({props:{name:"_forward_unimplemented",anchor:"transformers.ChameleonVQVAE.forward",parameters:[{name:"*input",val:": typing.Any"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/torch/nn/modules/module.py#L383"}}),D=new mt({props:{$$slots:{default:[xn]},$$scope:{ctx:v}}}),Ge=new w({props:{title:"ChameleonModel",local:"transformers.ChameleonModel ][ transformers.ChameleonModel",headingTag:"h2"}}),Be=new I({props:{name:"class transformers.ChameleonModel",anchor:"transformers.ChameleonModel",parameters:[{name:"config",val:": ChameleonConfig"}],parametersDescription:[{anchor:"transformers.ChameleonModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonConfig">ChameleonConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_22105/ko/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.ChameleonModel.config",description:"<strong>config</strong> &#x2014; ChameleonConfig",name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/modeling_chameleon.py#L1194"}}),Oe=new I({props:{name:"forward",anchor:"transformers.ChameleonModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"pixel_values",val:": FloatTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.ChameleonModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_22105/ko/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ChameleonModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape \`(batch_size, num_channels, image_size, image_size)) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<a href="/docs/transformers/pr_22105/ko/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_22105/ko/model_doc/vit#transformers.ViTFeatureExtractor.__call__">ChameleonImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChameleonModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_22105/ko/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.ChameleonModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ChameleonModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Should always be a <a href="/docs/transformers/pr_22105/ko/internal/generation_utils#transformers.Cache">Cache</a> instance and the model will output the same cache instance.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.ChameleonModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ChameleonModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.ChameleonModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ChameleonModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ChameleonModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_22105/ko/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ChameleonModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/modeling_chameleon.py#L1246",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_22105/ko/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonConfig"
>ChameleonConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_22105/ko/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),H=new mt({props:{$$slots:{default:[Wn]},$$scope:{ctx:v}}}),Y=new At({props:{anchor:"transformers.ChameleonModel.forward.example",$$slots:{default:[Nn]},$$scope:{ctx:v}}}),Pe=new w({props:{title:"ChameleonForConditionalGeneration",local:"transformers.ChameleonForConditionalGeneration ][ transformers.ChameleonForConditionalGeneration",headingTag:"h2"}}),Ae=new I({props:{name:"class transformers.ChameleonForConditionalGeneration",anchor:"transformers.ChameleonForConditionalGeneration",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ChameleonForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonConfig">ChameleonConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_22105/ko/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/modeling_chameleon.py#L1506"}}),Se=new I({props:{name:"forward",anchor:"transformers.ChameleonForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"pixel_values",val:": FloatTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.ChameleonForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_22105/ko/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape \`(batch_size, num_channels, image_size, image_size)) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<a href="/docs/transformers/pr_22105/ko/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_22105/ko/model_doc/vit#transformers.ViTFeatureExtractor.__call__">ChameleonImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_22105/ko/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_22105/ko/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Should always be a <a href="/docs/transformers/pr_22105/ko/internal/generation_utils#transformers.Cache">Cache</a> instance and the model will output the same cache instance.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_22105/ko/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"},{anchor:"transformers.ChameleonForConditionalGeneration.forward.Args",description:`<strong>Args</strong> &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"Args"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/chameleon/modeling_chameleon.py#L1540",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_22105/ko/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_22105/ko/model_doc/chameleon#transformers.ChameleonConfig"
>ChameleonConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_22105/ko/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),X=new mt({props:{$$slots:{default:[Zn]},$$scope:{ctx:v}}}),K=new At({props:{anchor:"transformers.ChameleonForConditionalGeneration.forward.example",$$slots:{default:[En]},$$scope:{ctx:v}}}),qe=new In({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/model_doc/chameleon.md"}}),{c(){r=i("meta"),C=n(),c=i("p"),y=n(),p(M.$$.fragment),m=n(),p(T.$$.fragment),Uo=n(),ae=i("p"),ae.innerHTML=St,vo=n(),se=i("p"),se.textContent=qt,wo=n(),re=i("p"),re.innerHTML=Lt,ko=n(),O=i("img"),Qo=n(),le=i("small"),le.innerHTML=Ht,Vo=n(),ie=i("p"),ie.innerHTML=Yt,$o=n(),p(de.$$.fragment),Jo=n(),ce=i("ul"),ce.innerHTML=Xt,jo=n(),me=i("blockquote"),me.innerHTML=Kt,Ro=n(),p(pe.$$.fragment),Io=n(),p(he.$$.fragment),zo=n(),fe=i("p"),fe.innerHTML=en,Fo=n(),p(ge.$$.fragment),xo=n(),p(ue.$$.fragment),Wo=n(),_e=i("p"),_e.textContent=on,No=n(),p(be.$$.fragment),Zo=n(),p(ye.$$.fragment),Eo=n(),p(Ce.$$.fragment),Go=n(),Me=i("p"),Me.innerHTML=tn,Bo=n(),p(P.$$.fragment),Oo=n(),Te=i("p"),Te.textContent=nn,Po=n(),p(Ue.$$.fragment),Ao=n(),p(ve.$$.fragment),So=n(),we=i("p"),we.innerHTML=an,qo=n(),p(ke.$$.fragment),Lo=n(),p(Qe.$$.fragment),Do=n(),J=i("div"),p(Ve.$$.fragment),pt=n(),eo=i("p"),eo.innerHTML=sn,ht=n(),oo=i("p"),oo.innerHTML=rn,ft=n(),p(A.$$.fragment),Ho=n(),p($e.$$.fragment),Yo=n(),G=i("div"),p(Je.$$.fragment),gt=n(),to=i("p"),to.innerHTML=ln,Xo=n(),p(je.$$.fragment),Ko=n(),k=i("div"),p(Re.$$.fragment),ut=n(),no=i("p"),no.textContent=dn,_t=n(),ao=i("p"),ao.innerHTML=cn,bt=n(),S=i("div"),p(Ie.$$.fragment),yt=n(),so=i("p"),so.innerHTML=mn,Ct=n(),q=i("div"),p(ze.$$.fragment),Mt=n(),ro=i("p"),ro.innerHTML=pn,et=n(),p(Fe.$$.fragment),ot=n(),W=i("div"),p(xe.$$.fragment),Tt=n(),lo=i("p"),lo.textContent=hn,Ut=n(),L=i("div"),p(We.$$.fragment),vt=n(),io=i("p"),io.textContent=fn,tt=n(),p(Ne.$$.fragment),nt=n(),Q=i("div"),p(Ze.$$.fragment),wt=n(),co=i("p"),co.innerHTML=gn,kt=n(),mo=i("p"),mo.innerHTML=un,Qt=n(),po=i("p"),po.innerHTML=_n,Vt=n(),z=i("div"),p(Ee.$$.fragment),$t=n(),ho=i("p"),ho.textContent=bn,Jt=n(),fo=i("p"),fo.textContent=yn,jt=n(),p(D.$$.fragment),at=n(),p(Ge.$$.fragment),st=n(),V=i("div"),p(Be.$$.fragment),Rt=n(),go=i("p"),go.innerHTML=Cn,It=n(),uo=i("p"),uo.innerHTML=Mn,zt=n(),_o=i("p"),_o.innerHTML=Tn,Ft=n(),F=i("div"),p(Oe.$$.fragment),xt=n(),bo=i("p"),bo.innerHTML=Un,Wt=n(),p(H.$$.fragment),Nt=n(),p(Y.$$.fragment),rt=n(),p(Pe.$$.fragment),lt=n(),j=i("div"),p(Ae.$$.fragment),Zt=n(),yo=i("p"),yo.innerHTML=vn,Et=n(),Co=i("p"),Co.innerHTML=wn,Gt=n(),x=i("div"),p(Se.$$.fragment),Bt=n(),Mo=i("p"),Mo.innerHTML=kn,Ot=n(),p(X.$$.fragment),Pt=n(),p(K.$$.fragment),it=n(),p(qe.$$.fragment),dt=n(),To=i("p"),this.h()},l(e){const o=Rn("svelte-u9bgzb",document.head);r=d(o,"META",{name:!0,content:!0}),o.forEach(t),C=a(e),c=d(e,"P",{}),$(c).forEach(t),y=a(e),h(M.$$.fragment,e),m=a(e),h(T.$$.fragment,e),Uo=a(e),ae=d(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-1h9tphz"&&(ae.innerHTML=St),vo=a(e),se=d(e,"P",{"data-svelte-h":!0}),b(se)!=="svelte-e5r8wp"&&(se.textContent=qt),wo=a(e),re=d(e,"P",{"data-svelte-h":!0}),b(re)!=="svelte-l55eb0"&&(re.innerHTML=Lt),ko=a(e),O=d(e,"IMG",{src:!0,alt:!0,width:!0}),Qo=a(e),le=d(e,"SMALL",{"data-svelte-h":!0}),b(le)!=="svelte-1qcmtht"&&(le.innerHTML=Ht),Vo=a(e),ie=d(e,"P",{"data-svelte-h":!0}),b(ie)!=="svelte-ze9xjr"&&(ie.innerHTML=Yt),$o=a(e),h(de.$$.fragment,e),Jo=a(e),ce=d(e,"UL",{"data-svelte-h":!0}),b(ce)!=="svelte-fee1ul"&&(ce.innerHTML=Xt),jo=a(e),me=d(e,"BLOCKQUOTE",{"data-svelte-h":!0}),b(me)!=="svelte-1yfan2w"&&(me.innerHTML=Kt),Ro=a(e),h(pe.$$.fragment,e),Io=a(e),h(he.$$.fragment,e),zo=a(e),fe=d(e,"P",{"data-svelte-h":!0}),b(fe)!=="svelte-alip5i"&&(fe.innerHTML=en),Fo=a(e),h(ge.$$.fragment,e),xo=a(e),h(ue.$$.fragment,e),Wo=a(e),_e=d(e,"P",{"data-svelte-h":!0}),b(_e)!=="svelte-h13ajp"&&(_e.textContent=on),No=a(e),h(be.$$.fragment,e),Zo=a(e),h(ye.$$.fragment,e),Eo=a(e),h(Ce.$$.fragment,e),Go=a(e),Me=d(e,"P",{"data-svelte-h":!0}),b(Me)!=="svelte-1k0gwd6"&&(Me.innerHTML=tn),Bo=a(e),h(P.$$.fragment,e),Oo=a(e),Te=d(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-2v30pe"&&(Te.textContent=nn),Po=a(e),h(Ue.$$.fragment,e),Ao=a(e),h(ve.$$.fragment,e),So=a(e),we=d(e,"P",{"data-svelte-h":!0}),b(we)!=="svelte-10oxohd"&&(we.innerHTML=an),qo=a(e),h(ke.$$.fragment,e),Lo=a(e),h(Qe.$$.fragment,e),Do=a(e),J=d(e,"DIV",{class:!0});var N=$(J);h(Ve.$$.fragment,N),pt=a(N),eo=d(N,"P",{"data-svelte-h":!0}),b(eo)!=="svelte-10ghnat"&&(eo.innerHTML=sn),ht=a(N),oo=d(N,"P",{"data-svelte-h":!0}),b(oo)!=="svelte-3joicb"&&(oo.innerHTML=rn),ft=a(N),h(A.$$.fragment,N),N.forEach(t),Ho=a(e),h($e.$$.fragment,e),Yo=a(e),G=d(e,"DIV",{class:!0});var Le=$(G);h(Je.$$.fragment,Le),gt=a(Le),to=d(Le,"P",{"data-svelte-h":!0}),b(to)!=="svelte-1k1zeqv"&&(to.innerHTML=ln),Le.forEach(t),Xo=a(e),h(je.$$.fragment,e),Ko=a(e),k=d(e,"DIV",{class:!0});var R=$(k);h(Re.$$.fragment,R),ut=a(R),no=d(R,"P",{"data-svelte-h":!0}),b(no)!=="svelte-8u0vzv"&&(no.textContent=dn),_t=a(R),ao=d(R,"P",{"data-svelte-h":!0}),b(ao)!=="svelte-kcw1rn"&&(ao.innerHTML=cn),bt=a(R),S=d(R,"DIV",{class:!0});var De=$(S);h(Ie.$$.fragment,De),yt=a(De),so=d(De,"P",{"data-svelte-h":!0}),b(so)!=="svelte-ox77q5"&&(so.innerHTML=mn),De.forEach(t),Ct=a(R),q=d(R,"DIV",{class:!0});var He=$(q);h(ze.$$.fragment,He),Mt=a(He),ro=d(He,"P",{"data-svelte-h":!0}),b(ro)!=="svelte-ahzp4v"&&(ro.innerHTML=pn),He.forEach(t),R.forEach(t),et=a(e),h(Fe.$$.fragment,e),ot=a(e),W=d(e,"DIV",{class:!0});var B=$(W);h(xe.$$.fragment,B),Tt=a(B),lo=d(B,"P",{"data-svelte-h":!0}),b(lo)!=="svelte-p2ya4c"&&(lo.textContent=hn),Ut=a(B),L=d(B,"DIV",{class:!0});var Ye=$(L);h(We.$$.fragment,Ye),vt=a(Ye),io=d(Ye,"P",{"data-svelte-h":!0}),b(io)!=="svelte-1x3yxsa"&&(io.textContent=fn),Ye.forEach(t),B.forEach(t),tt=a(e),h(Ne.$$.fragment,e),nt=a(e),Q=d(e,"DIV",{class:!0});var Z=$(Q);h(Ze.$$.fragment,Z),wt=a(Z),co=d(Z,"P",{"data-svelte-h":!0}),b(co)!=="svelte-1yzmrhf"&&(co.innerHTML=gn),kt=a(Z),mo=d(Z,"P",{"data-svelte-h":!0}),b(mo)!=="svelte-c0a1if"&&(mo.innerHTML=un),Qt=a(Z),po=d(Z,"P",{"data-svelte-h":!0}),b(po)!=="svelte-hswkmf"&&(po.innerHTML=_n),Vt=a(Z),z=d(Z,"DIV",{class:!0});var ee=$(z);h(Ee.$$.fragment,ee),$t=a(ee),ho=d(ee,"P",{"data-svelte-h":!0}),b(ho)!=="svelte-1q5ym45"&&(ho.textContent=bn),Jt=a(ee),fo=d(ee,"P",{"data-svelte-h":!0}),b(fo)!=="svelte-w8wo9i"&&(fo.textContent=yn),jt=a(ee),h(D.$$.fragment,ee),ee.forEach(t),Z.forEach(t),at=a(e),h(Ge.$$.fragment,e),st=a(e),V=d(e,"DIV",{class:!0});var E=$(V);h(Be.$$.fragment,E),Rt=a(E),go=d(E,"P",{"data-svelte-h":!0}),b(go)!=="svelte-9tqlm5"&&(go.innerHTML=Cn),It=a(E),uo=d(E,"P",{"data-svelte-h":!0}),b(uo)!=="svelte-hswkmf"&&(uo.innerHTML=Mn),zt=a(E),_o=d(E,"P",{"data-svelte-h":!0}),b(_o)!=="svelte-18w1z2r"&&(_o.innerHTML=Tn),Ft=a(E),F=d(E,"DIV",{class:!0});var oe=$(F);h(Oe.$$.fragment,oe),xt=a(oe),bo=d(oe,"P",{"data-svelte-h":!0}),b(bo)!=="svelte-126j94e"&&(bo.innerHTML=Un),Wt=a(oe),h(H.$$.fragment,oe),Nt=a(oe),h(Y.$$.fragment,oe),oe.forEach(t),E.forEach(t),rt=a(e),h(Pe.$$.fragment,e),lt=a(e),j=d(e,"DIV",{class:!0});var te=$(j);h(Ae.$$.fragment,te),Zt=a(te),yo=d(te,"P",{"data-svelte-h":!0}),b(yo)!=="svelte-jhvpbo"&&(yo.innerHTML=vn),Et=a(te),Co=d(te,"P",{"data-svelte-h":!0}),b(Co)!=="svelte-hswkmf"&&(Co.innerHTML=wn),Gt=a(te),x=d(te,"DIV",{class:!0});var ne=$(x);h(Se.$$.fragment,ne),Bt=a(ne),Mo=d(ne,"P",{"data-svelte-h":!0}),b(Mo)!=="svelte-wzinms"&&(Mo.innerHTML=kn),Ot=a(ne),h(X.$$.fragment,ne),Pt=a(ne),h(K.$$.fragment,ne),ne.forEach(t),te.forEach(t),it=a(e),h(qe.$$.fragment,e),dt=a(e),To=d(e,"P",{}),$(To).forEach(t),this.h()},h(){U(r,"name","hf:doc:metadata"),U(r,"content",Bn),Vn(O.src,Dt="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/chameleon_arch.png")||U(O,"src",Dt),U(O,"alt","drawing"),U(O,"width","600"),U(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){l(document.head,r),s(e,C,o),s(e,c,o),s(e,y,o),f(M,e,o),s(e,m,o),f(T,e,o),s(e,Uo,o),s(e,ae,o),s(e,vo,o),s(e,se,o),s(e,wo,o),s(e,re,o),s(e,ko,o),s(e,O,o),s(e,Qo,o),s(e,le,o),s(e,Vo,o),s(e,ie,o),s(e,$o,o),f(de,e,o),s(e,Jo,o),s(e,ce,o),s(e,jo,o),s(e,me,o),s(e,Ro,o),f(pe,e,o),s(e,Io,o),f(he,e,o),s(e,zo,o),s(e,fe,o),s(e,Fo,o),f(ge,e,o),s(e,xo,o),f(ue,e,o),s(e,Wo,o),s(e,_e,o),s(e,No,o),f(be,e,o),s(e,Zo,o),f(ye,e,o),s(e,Eo,o),f(Ce,e,o),s(e,Go,o),s(e,Me,o),s(e,Bo,o),f(P,e,o),s(e,Oo,o),s(e,Te,o),s(e,Po,o),f(Ue,e,o),s(e,Ao,o),f(ve,e,o),s(e,So,o),s(e,we,o),s(e,qo,o),f(ke,e,o),s(e,Lo,o),f(Qe,e,o),s(e,Do,o),s(e,J,o),f(Ve,J,null),l(J,pt),l(J,eo),l(J,ht),l(J,oo),l(J,ft),f(A,J,null),s(e,Ho,o),f($e,e,o),s(e,Yo,o),s(e,G,o),f(Je,G,null),l(G,gt),l(G,to),s(e,Xo,o),f(je,e,o),s(e,Ko,o),s(e,k,o),f(Re,k,null),l(k,ut),l(k,no),l(k,_t),l(k,ao),l(k,bt),l(k,S),f(Ie,S,null),l(S,yt),l(S,so),l(k,Ct),l(k,q),f(ze,q,null),l(q,Mt),l(q,ro),s(e,et,o),f(Fe,e,o),s(e,ot,o),s(e,W,o),f(xe,W,null),l(W,Tt),l(W,lo),l(W,Ut),l(W,L),f(We,L,null),l(L,vt),l(L,io),s(e,tt,o),f(Ne,e,o),s(e,nt,o),s(e,Q,o),f(Ze,Q,null),l(Q,wt),l(Q,co),l(Q,kt),l(Q,mo),l(Q,Qt),l(Q,po),l(Q,Vt),l(Q,z),f(Ee,z,null),l(z,$t),l(z,ho),l(z,Jt),l(z,fo),l(z,jt),f(D,z,null),s(e,at,o),f(Ge,e,o),s(e,st,o),s(e,V,o),f(Be,V,null),l(V,Rt),l(V,go),l(V,It),l(V,uo),l(V,zt),l(V,_o),l(V,Ft),l(V,F),f(Oe,F,null),l(F,xt),l(F,bo),l(F,Wt),f(H,F,null),l(F,Nt),f(Y,F,null),s(e,rt,o),f(Pe,e,o),s(e,lt,o),s(e,j,o),f(Ae,j,null),l(j,Zt),l(j,yo),l(j,Et),l(j,Co),l(j,Gt),l(j,x),f(Se,x,null),l(x,Bt),l(x,Mo),l(x,Ot),f(X,x,null),l(x,Pt),f(K,x,null),s(e,it,o),f(qe,e,o),s(e,dt,o),s(e,To,o),ct=!0},p(e,[o]){const N={};o&2&&(N.$$scope={dirty:o,ctx:e}),P.$set(N);const Le={};o&2&&(Le.$$scope={dirty:o,ctx:e}),A.$set(Le);const R={};o&2&&(R.$$scope={dirty:o,ctx:e}),D.$set(R);const De={};o&2&&(De.$$scope={dirty:o,ctx:e}),H.$set(De);const He={};o&2&&(He.$$scope={dirty:o,ctx:e}),Y.$set(He);const B={};o&2&&(B.$$scope={dirty:o,ctx:e}),X.$set(B);const Ye={};o&2&&(Ye.$$scope={dirty:o,ctx:e}),K.$set(Ye)},i(e){ct||(g(M.$$.fragment,e),g(T.$$.fragment,e),g(de.$$.fragment,e),g(pe.$$.fragment,e),g(he.$$.fragment,e),g(ge.$$.fragment,e),g(ue.$$.fragment,e),g(be.$$.fragment,e),g(ye.$$.fragment,e),g(Ce.$$.fragment,e),g(P.$$.fragment,e),g(Ue.$$.fragment,e),g(ve.$$.fragment,e),g(ke.$$.fragment,e),g(Qe.$$.fragment,e),g(Ve.$$.fragment,e),g(A.$$.fragment,e),g($e.$$.fragment,e),g(Je.$$.fragment,e),g(je.$$.fragment,e),g(Re.$$.fragment,e),g(Ie.$$.fragment,e),g(ze.$$.fragment,e),g(Fe.$$.fragment,e),g(xe.$$.fragment,e),g(We.$$.fragment,e),g(Ne.$$.fragment,e),g(Ze.$$.fragment,e),g(Ee.$$.fragment,e),g(D.$$.fragment,e),g(Ge.$$.fragment,e),g(Be.$$.fragment,e),g(Oe.$$.fragment,e),g(H.$$.fragment,e),g(Y.$$.fragment,e),g(Pe.$$.fragment,e),g(Ae.$$.fragment,e),g(Se.$$.fragment,e),g(X.$$.fragment,e),g(K.$$.fragment,e),g(qe.$$.fragment,e),ct=!0)},o(e){u(M.$$.fragment,e),u(T.$$.fragment,e),u(de.$$.fragment,e),u(pe.$$.fragment,e),u(he.$$.fragment,e),u(ge.$$.fragment,e),u(ue.$$.fragment,e),u(be.$$.fragment,e),u(ye.$$.fragment,e),u(Ce.$$.fragment,e),u(P.$$.fragment,e),u(Ue.$$.fragment,e),u(ve.$$.fragment,e),u(ke.$$.fragment,e),u(Qe.$$.fragment,e),u(Ve.$$.fragment,e),u(A.$$.fragment,e),u($e.$$.fragment,e),u(Je.$$.fragment,e),u(je.$$.fragment,e),u(Re.$$.fragment,e),u(Ie.$$.fragment,e),u(ze.$$.fragment,e),u(Fe.$$.fragment,e),u(xe.$$.fragment,e),u(We.$$.fragment,e),u(Ne.$$.fragment,e),u(Ze.$$.fragment,e),u(Ee.$$.fragment,e),u(D.$$.fragment,e),u(Ge.$$.fragment,e),u(Be.$$.fragment,e),u(Oe.$$.fragment,e),u(H.$$.fragment,e),u(Y.$$.fragment,e),u(Pe.$$.fragment,e),u(Ae.$$.fragment,e),u(Se.$$.fragment,e),u(X.$$.fragment,e),u(K.$$.fragment,e),u(qe.$$.fragment,e),ct=!1},d(e){e&&(t(C),t(c),t(y),t(m),t(Uo),t(ae),t(vo),t(se),t(wo),t(re),t(ko),t(O),t(Qo),t(le),t(Vo),t(ie),t($o),t(Jo),t(ce),t(jo),t(me),t(Ro),t(Io),t(zo),t(fe),t(Fo),t(xo),t(Wo),t(_e),t(No),t(Zo),t(Eo),t(Go),t(Me),t(Bo),t(Oo),t(Te),t(Po),t(Ao),t(So),t(we),t(qo),t(Lo),t(Do),t(J),t(Ho),t(Yo),t(G),t(Xo),t(Ko),t(k),t(et),t(ot),t(W),t(tt),t(nt),t(Q),t(at),t(st),t(V),t(rt),t(lt),t(j),t(it),t(dt),t(To)),t(r),_(M,e),_(T,e),_(de,e),_(pe,e),_(he,e),_(ge,e),_(ue,e),_(be,e),_(ye,e),_(Ce,e),_(P,e),_(Ue,e),_(ve,e),_(ke,e),_(Qe,e),_(Ve),_(A),_($e,e),_(Je),_(je,e),_(Re),_(Ie),_(ze),_(Fe,e),_(xe),_(We),_(Ne,e),_(Ze),_(Ee),_(D),_(Ge,e),_(Be),_(Oe),_(H),_(Y),_(Pe,e),_(Ae),_(Se),_(X),_(K),_(qe,e)}}}const Bn='{"title":"Chameleon","local":"chameleon","sections":[{"title":"개요","local":"overview","sections":[],"depth":2},{"title":"사용 팁","local":"usage-tips","sections":[],"depth":2},{"title":"사용 예제","local":"usage-example","sections":[{"title":"단일 이미지 추론","local":"single-image-inference","sections":[],"depth":3},{"title":"다중 이미지 추론","local":"multi-image-inference","sections":[],"depth":3}],"depth":2},{"title":"모델 최적화","local":"model-optimization","sections":[{"title":"Bitsandbytes를 사용한 양자화","local":"quantization-using-bitsandbytes","sections":[],"depth":3},{"title":"Flash-Attention 2와 SDPA를 사용하여 생성 속도 향상","local":"use-flash-attention-2-and-sdpa-to-further-speed-up-generation","sections":[],"depth":3}],"depth":2},{"title":"ChameleonConfig","local":"transformers.ChameleonConfig ][ transformers.ChameleonConfig","sections":[],"depth":2},{"title":"ChameleonVQVAEConfig","local":"transformers.ChameleonVQVAEConfig ][ transformers.ChameleonVQVAEConfig","sections":[],"depth":2},{"title":"ChameleonProcessor","local":"transformers.ChameleonProcessor ][ transformers.ChameleonProcessor","sections":[],"depth":2},{"title":"ChameleonImageProcessor","local":"transformers.ChameleonImageProcessor ][ transformers.ChameleonImageProcessor","sections":[],"depth":2},{"title":"ChameleonVQVAE","local":"transformers.ChameleonVQVAE ][ transformers.ChameleonVQVAE","sections":[],"depth":2},{"title":"ChameleonModel","local":"transformers.ChameleonModel ][ transformers.ChameleonModel","sections":[],"depth":2},{"title":"ChameleonForConditionalGeneration","local":"transformers.ChameleonForConditionalGeneration ][ transformers.ChameleonForConditionalGeneration","sections":[],"depth":2}],"depth":1}';function On(v){return $n(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yn extends Jn{constructor(r){super(),jn(this,r,On,Gn,Qn,{})}}export{Yn as component};
