Buckets:

rtrm's picture
download
raw
24.3 kB
import{s as Ie,o as Pe,n as We}from"../chunks/scheduler.53228c21.js";import{S as Qe,i as Xe,e as i,s,c,h as He,a as r,d as n,b as a,f as K,g as m,j as k,k as ee,l as y,m as l,n as _,t as u,o as f,p as h}from"../chunks/index.100fac89.js";import{C as qe}from"../chunks/CopyLLMTxtMenu.2bfe8872.js";import{D as we}from"../chunks/Docstring.65b2998b.js";import{C as ve}from"../chunks/CodeBlock.d30a6509.js";import{E as Se}from"../chunks/ExampleCodeBlock.ea177298.js";import{H as Y,E as ze}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e20ef58b.js";function Fe(te){let p,$="Examples:",L,b,M;return b=new ve({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEJsb2NrUmVmaW5lbWVudFNjaGVkdWxlciUyQyUyMExMYURBMlBpcGVsaW5lJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJpbmNsdXNpb25BSSUyRkxMYURBMi4xLW1pbmklMjIlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSUyQyUyMGR0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMjBkZXZpY2VfbWFwJTNEJTIyYXV0byUyMiUwQSklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFzY2hlZHVsZXIlMjAlM0QlMjBCbG9ja1JlZmluZW1lbnRTY2hlZHVsZXIoKSUwQSUwQXBpcGUlMjAlM0QlMjBMTGFEQTJQaXBlbGluZShtb2RlbCUzRG1vZGVsJTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyJTJDJTIwdG9rZW5pemVyJTNEdG9rZW5pemVyKSUwQW91dHB1dCUyMCUzRCUyMHBpcGUocHJvbXB0JTNEJTIyV2hhdCUyMGlzJTIwdGhlJTIwbWVhbmluZyUyMG9mJTIwbGlmZSUzRiUyMiUyQyUyMGdlbl9sZW5ndGglM0QyNTYpJTBBcHJpbnQob3V0cHV0LnRleHRzJTVCMCU1RCk=",highlighted:`<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">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> BlockRefinementScheduler, LLaDA2Pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span>model_id = <span class="hljs-string">&quot;inclusionAI/LLaDA2.1-mini&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(
<span class="hljs-meta">... </span> model_id, trust_remote_code=<span class="hljs-literal">True</span>, dtype=torch.bfloat16, device_map=<span class="hljs-string">&quot;auto&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = BlockRefinementScheduler()
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = LLaDA2Pipeline(model=model, scheduler=scheduler, tokenizer=tokenizer)
<span class="hljs-meta">&gt;&gt;&gt; </span>output = pipe(prompt=<span class="hljs-string">&quot;What is the meaning of life?&quot;</span>, gen_length=<span class="hljs-number">256</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(output.texts[<span class="hljs-number">0</span>])`,wrap:!1}}),{c(){p=i("p"),p.textContent=$,L=s(),c(b.$$.fragment)},l(o){p=r(o,"P",{"data-svelte-h":!0}),k(p)!=="svelte-kvfsh7"&&(p.textContent=$),L=a(o),m(b.$$.fragment,o)},m(o,T){l(o,p,T),l(o,L,T),_(b,o,T),M=!0},p:We,i(o){M||(u(b.$$.fragment,o),M=!0)},o(o){f(b.$$.fragment,o),M=!1},d(o){o&&(n(p),n(L)),h(b,o)}}}function Ye(te){let p,$,L,b,M,o,T,ne,w,Ue=`<a href="https://huggingface.co/collections/inclusionAI/llada21" rel="nofollow">LLaDA2</a> is a family of discrete diffusion language models
that generate text through block-wise iterative refinement. Instead of autoregressive token-by-token generation,
LLaDA2 starts with a fully masked sequence and progressively unmasks tokens by confidence over multiple refinement
steps.`,le,v,se,U,ae,x,oe,A,xe=`Callbacks run after each refinement step. Pass <code>callback_on_step_end_tensor_inputs</code> to select which tensors are
included in <code>callback_kwargs</code>. In the current implementation, <code>block_x</code> (the sequence window being refined) and
<code>transfer_index</code> (mask-filling commit mask) are provided; return <code>{&quot;block_x&quot;: ...}</code> from the callback to replace the
window.`,ie,N,re,C,pe,B,Ae="LLaDA2.1 models support two modes:",de,Z,Ne="<thead><tr><th>Mode</th> <th><code>threshold</code></th> <th><code>editing_threshold</code></th> <th><code>max_post_steps</code></th></tr></thead> <tbody><tr><td>Quality</td> <td>0.7</td> <td>0.5</td> <td>16</td></tr> <tr><td>Speed</td> <td>0.5</td> <td><code>None</code></td> <td>16</td></tr></tbody>",ce,G,Ce="Pass <code>editing_threshold=None</code>, <code>0.0</code>, or a negative value to turn off post-mask editing.",me,E,Be="For LLaDA2.0 models, disable editing by passing <code>editing_threshold=None</code> or <code>0.0</code>.",_e,D,Ze="For all models: <code>block_length=32</code>, <code>temperature=0.0</code>, <code>num_inference_steps=32</code>.",ue,R,fe,d,V,ke,H,Ge="Pipeline for LLaDA2-style discrete diffusion text generation via block-wise iterative refinement.",Te,q,Ee=`This pipeline maintains a template sequence filled with a <code>mask_token_id</code> and refines it in blocks. In each
refinement step, it samples candidate tokens for the active block and commits a subset based on confidence.`,Le,S,De="The model is expected to accept an attention mask and <code>position_ids</code>, and to return logits of shape <code>[batch, seq, vocab_size]</code>.",Je,J,I,je,z,Re="Generate text with block-wise refinement.",$e,j,he,P,ge,W,Q,be,X,Me,O,ye;return M=new qe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),T=new Y({props:{title:"LLaDA2",local:"llada2",headingTag:"h1"}}),v=new Y({props:{title:"Usage",local:"usage",headingTag:"h2"}}),U=new ve({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEJsb2NrUmVmaW5lbWVudFNjaGVkdWxlciUyQyUyMExMYURBMlBpcGVsaW5lJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJpbmNsdXNpb25BSSUyRkxMYURBMi4xLW1pbmklMjIlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSUyQyUyMGR0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMjBkZXZpY2VfbWFwJTNEJTIyYXV0byUyMiUwQSklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFzY2hlZHVsZXIlMjAlM0QlMjBCbG9ja1JlZmluZW1lbnRTY2hlZHVsZXIoKSUwQSUwQXBpcGUlMjAlM0QlMjBMTGFEQTJQaXBlbGluZShtb2RlbCUzRG1vZGVsJTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyJTJDJTIwdG9rZW5pemVyJTNEdG9rZW5pemVyKSUwQW91dHB1dCUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEJTIyV3JpdGUlMjBhJTIwc2hvcnQlMjBwb2VtJTIwYWJvdXQlMjB0aGUlMjBvY2Vhbi4lMjIlMkMlMEElMjAlMjAlMjAlMjBnZW5fbGVuZ3RoJTNEMjU2JTJDJTBBJTIwJTIwJTIwJTIwYmxvY2tfbGVuZ3RoJTNEMzIlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzIlMkMlMEElMjAlMjAlMjAlMjB0aHJlc2hvbGQlM0QwLjclMkMlMEElMjAlMjAlMjAlMjBlZGl0aW5nX3RocmVzaG9sZCUzRDAuNSUyQyUwQSUyMCUyMCUyMCUyMG1heF9wb3N0X3N0ZXBzJTNEMTYlMkMlMEElMjAlMjAlMjAlMjB0ZW1wZXJhdHVyZSUzRDAuMCUyQyUwQSklMEFwcmludChvdXRwdXQudGV4dHMlNUIwJTVEKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> BlockRefinementScheduler, LLaDA2Pipeline
model_id = <span class="hljs-string">&quot;inclusionAI/LLaDA2.1-mini&quot;</span>
model = AutoModelForCausalLM.from_pretrained(
model_id, trust_remote_code=<span class="hljs-literal">True</span>, dtype=torch.bfloat16, device_map=<span class="hljs-string">&quot;auto&quot;</span>
)
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=<span class="hljs-literal">True</span>)
scheduler = BlockRefinementScheduler()
pipe = LLaDA2Pipeline(model=model, scheduler=scheduler, tokenizer=tokenizer)
output = pipe(
prompt=<span class="hljs-string">&quot;Write a short poem about the ocean.&quot;</span>,
gen_length=<span class="hljs-number">256</span>,
block_length=<span class="hljs-number">32</span>,
num_inference_steps=<span class="hljs-number">32</span>,
threshold=<span class="hljs-number">0.7</span>,
editing_threshold=<span class="hljs-number">0.5</span>,
max_post_steps=<span class="hljs-number">16</span>,
temperature=<span class="hljs-number">0.0</span>,
)
<span class="hljs-built_in">print</span>(output.texts[<span class="hljs-number">0</span>])`,wrap:!1}}),x=new Y({props:{title:"Callbacks",local:"callbacks",headingTag:"h2"}}),N=new ve({props:{code:"ZGVmJTIwb25fc3RlcF9lbmQocGlwZSUyQyUyMHN0ZXAlMkMlMjB0aW1lc3RlcCUyQyUyMGNhbGxiYWNrX2t3YXJncyklM0ElMEElMjAlMjAlMjAlMjBibG9ja194JTIwJTNEJTIwY2FsbGJhY2tfa3dhcmdzJTVCJTIyYmxvY2tfeCUyMiU1RCUwQSUyMCUyMCUyMCUyMCUyMyUyMEluc3BlY3QlMjBvciUyMG1vZGlmeSUyMCU2MGJsb2NrX3glNjAlMjBoZXJlLiUwQSUyMCUyMCUyMCUyMHJldHVybiUyMCU3QiUyMmJsb2NrX3glMjIlM0ElMjBibG9ja194JTdEJTBBJTBBb3V0JTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0QlMjJXcml0ZSUyMGElMjBzaG9ydCUyMHBvZW0uJTIyJTJDJTBBJTIwJTIwJTIwJTIwY2FsbGJhY2tfb25fc3RlcF9lbmQlM0Rvbl9zdGVwX2VuZCUyQyUwQSUyMCUyMCUyMCUyMGNhbGxiYWNrX29uX3N0ZXBfZW5kX3RlbnNvcl9pbnB1dHMlM0QlNUIlMjJibG9ja194JTIyJTVEJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">on_step_end</span>(<span class="hljs-params">pipe, step, timestep, callback_kwargs</span>):
block_x = callback_kwargs[<span class="hljs-string">&quot;block_x&quot;</span>]
<span class="hljs-comment"># Inspect or modify \`block_x\` here.</span>
<span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;block_x&quot;</span>: block_x}
out = pipe(
prompt=<span class="hljs-string">&quot;Write a short poem.&quot;</span>,
callback_on_step_end=on_step_end,
callback_on_step_end_tensor_inputs=[<span class="hljs-string">&quot;block_x&quot;</span>],
)`,wrap:!1}}),C=new Y({props:{title:"Recommended parameters",local:"recommended-parameters",headingTag:"h2"}}),R=new Y({props:{title:"LLaDA2Pipeline",local:"diffusers.LLaDA2Pipeline",headingTag:"h2"}}),V=new we({props:{name:"class diffusers.LLaDA2Pipeline",anchor:"diffusers.LLaDA2Pipeline",parameters:[{name:"model",val:": Any"},{name:"scheduler",val:": BlockRefinementScheduler"},{name:"tokenizer",val:": Any | None = None"}],source:"https://github.com/huggingface/diffusers/blob/vr_13360/src/diffusers/pipelines/llada2/pipeline_llada2.py#L59"}}),I=new we({props:{name:"__call__",anchor:"diffusers.LLaDA2Pipeline.__call__",parameters:[{name:"prompt",val:": str | list[str] | None = None"},{name:"messages",val:": list[dict[str, str]] | None = None"},{name:"input_ids",val:": torch.LongTensor | None = None"},{name:"use_chat_template",val:": bool = True"},{name:"add_generation_prompt",val:": bool = True"},{name:"gen_length",val:": int = 2048"},{name:"block_length",val:": int = 32"},{name:"num_inference_steps",val:": int = 32"},{name:"temperature",val:": float = 0.0"},{name:"top_p",val:": float | None = None"},{name:"top_k",val:": int | None = None"},{name:"sampling_method",val:": str = 'multinomial'"},{name:"threshold",val:": float = 0.7"},{name:"editing_threshold",val:": float | None = 0.5"},{name:"max_post_steps",val:": int = 16"},{name:"minimal_topk",val:": int = 1"},{name:"eos_early_stop",val:": bool = True"},{name:"eos_token_id",val:": int | None = None"},{name:"mask_token_id",val:": int | None = None"},{name:"generator",val:": torch.Generator | None = None"},{name:"output_type",val:": str = 'text'"},{name:"return_dict",val:": bool = True"},{name:"callback_on_step_end",val:": Callable[[int, int, dict], None] | PipelineCallback | MultiPipelineCallbacks | None = None"},{name:"callback_on_step_end_tensor_inputs",val:": list[str] | None = None"}],parametersDescription:[{anchor:"diffusers.LLaDA2Pipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Prompt text. When <code>use_chat_template</code> is <code>True</code> (default) and a tokenizer with a chat template is
available, the prompt is wrapped in a chat message before tokenization.`,name:"prompt"},{anchor:"diffusers.LLaDA2Pipeline.__call__.messages",description:`<strong>messages</strong> (<code>List[Dict[str, str]]</code>, <em>optional</em>) &#x2014;
Chat messages to encode (e.g. <code>[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Hello&quot;}]</code>). Takes precedence over <code>prompt</code>
when provided. Requires a tokenizer with <code>apply_chat_template</code>.`,name:"messages"},{anchor:"diffusers.LLaDA2Pipeline.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
Pre-tokenized input IDs. Takes precedence over <code>prompt</code> and <code>messages</code>.`,name:"input_ids"},{anchor:"diffusers.LLaDA2Pipeline.__call__.use_chat_template",description:`<strong>use_chat_template</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to wrap the prompt in a chat template.`,name:"use_chat_template"},{anchor:"diffusers.LLaDA2Pipeline.__call__.add_generation_prompt",description:`<strong>add_generation_prompt</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to add the generation prompt when using chat templates.`,name:"add_generation_prompt"},{anchor:"diffusers.LLaDA2Pipeline.__call__.gen_length",description:`<strong>gen_length</strong> (<code>int</code>) &#x2014;
Number of tokens to generate.`,name:"gen_length"},{anchor:"diffusers.LLaDA2Pipeline.__call__.block_length",description:`<strong>block_length</strong> (<code>int</code>) &#x2014;
Block size for refinement.`,name:"block_length"},{anchor:"diffusers.LLaDA2Pipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>) &#x2014;
Number of refinement steps per block.`,name:"num_inference_steps"},{anchor:"diffusers.LLaDA2Pipeline.__call__.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
Sampling temperature.`,name:"temperature"},{anchor:"diffusers.LLaDA2Pipeline.__call__.top_p",description:`<strong>top_p</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Nucleus sampling cutoff.`,name:"top_p"},{anchor:"diffusers.LLaDA2Pipeline.__call__.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Top-k sampling cutoff.`,name:"top_k"},{anchor:"diffusers.LLaDA2Pipeline.__call__.sampling_method",description:`<strong>sampling_method</strong> (<code>str</code>) &#x2014;
Sampling method (<code>auto</code>, <code>greedy</code>, <code>multinomial</code>).`,name:"sampling_method"},{anchor:"diffusers.LLaDA2Pipeline.__call__.threshold",description:`<strong>threshold</strong> (<code>float</code>) &#x2014;
Confidence threshold for committing tokens.`,name:"threshold"},{anchor:"diffusers.LLaDA2Pipeline.__call__.editing_threshold",description:`<strong>editing_threshold</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Confidence threshold for editing already-committed (non-mask) tokens. When positive, after all mask
tokens in a block are resolved, the pipeline continues refining: if the model predicts a different
token with confidence above this threshold, the existing token is replaced. Set to <code>None</code>, <code>0.0</code>, or a
negative value to disable editing. Defaults to <code>0.5</code>.`,name:"editing_threshold"},{anchor:"diffusers.LLaDA2Pipeline.__call__.max_post_steps",description:`<strong>max_post_steps</strong> (<code>int</code>) &#x2014;
Maximum number of additional refinement iterations after all mask tokens in a block are resolved. Only
used when <code>editing_threshold</code> is enabled. Defaults to <code>16</code>.`,name:"max_post_steps"},{anchor:"diffusers.LLaDA2Pipeline.__call__.minimal_topk",description:`<strong>minimal_topk</strong> (<code>int</code>) &#x2014;
Minimum number of tokens to commit per step.`,name:"minimal_topk"},{anchor:"diffusers.LLaDA2Pipeline.__call__.eos_early_stop",description:`<strong>eos_early_stop</strong> (<code>bool</code>) &#x2014;
Whether to stop after committing EOS in a block.`,name:"eos_early_stop"},{anchor:"diffusers.LLaDA2Pipeline.__call__.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
EOS token ID to use for early stopping.`,name:"eos_token_id"},{anchor:"diffusers.LLaDA2Pipeline.__call__.mask_token_id",description:`<strong>mask_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Mask token ID to use for the template.`,name:"mask_token_id"},{anchor:"diffusers.LLaDA2Pipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
RNG for sampling.`,name:"generator"},{anchor:"diffusers.LLaDA2Pipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, defaults to <code>&quot;text&quot;</code>) &#x2014;
Output format. <code>&quot;text&quot;</code> decodes sequences into strings (requires a tokenizer). <code>&quot;seq&quot;</code> returns raw
token ID sequences only.`,name:"output_type"},{anchor:"diffusers.LLaDA2Pipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return a <a href="/docs/diffusers/pr_13360/en/api/pipelines/llada2#diffusers.LLaDA2PipelineOutput">LLaDA2PipelineOutput</a> instead of a tuple.`,name:"return_dict"},{anchor:"diffusers.LLaDA2Pipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code> or <code>PipelineCallback</code>, <em>optional</em>) &#x2014;
Callback executed after each refinement step with signature <code>callback_on_step_end(self, step: int, timestep: int, callback_kwargs: Dict)</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.LLaDA2Pipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Tensor keys to pass to the callback. Allowed keys: <code>block_x</code>, <code>x0</code>, <code>x0_p</code>, <code>transfer_index</code>,
<code>confidence</code>, <code>active_block</code>.`,name:"callback_on_step_end_tensor_inputs"}],source:"https://github.com/huggingface/diffusers/blob/vr_13360/src/diffusers/pipelines/llada2/pipeline_llada2.py#L211"}}),j=new Se({props:{anchor:"diffusers.LLaDA2Pipeline.__call__.example",$$slots:{default:[Fe]},$$scope:{ctx:te}}}),P=new Y({props:{title:"LLaDA2PipelineOutput",local:"diffusers.LLaDA2PipelineOutput",headingTag:"h2"}}),Q=new we({props:{name:"class diffusers.LLaDA2PipelineOutput",anchor:"diffusers.LLaDA2PipelineOutput",parameters:[{name:"sequences",val:": torch.LongTensor"},{name:"texts",val:": list[str] | None = None"}],source:"https://github.com/huggingface/diffusers/blob/vr_13360/src/diffusers/pipelines/llada2/pipeline_llada2.py#L54"}}),X=new ze({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/llada2.md"}}),{c(){p=i("meta"),$=s(),L=i("p"),b=s(),c(M.$$.fragment),o=s(),c(T.$$.fragment),ne=s(),w=i("p"),w.innerHTML=Ue,le=s(),c(v.$$.fragment),se=s(),c(U.$$.fragment),ae=s(),c(x.$$.fragment),oe=s(),A=i("p"),A.innerHTML=xe,ie=s(),c(N.$$.fragment),re=s(),c(C.$$.fragment),pe=s(),B=i("p"),B.textContent=Ae,de=s(),Z=i("table"),Z.innerHTML=Ne,ce=s(),G=i("p"),G.innerHTML=Ce,me=s(),E=i("p"),E.innerHTML=Be,_e=s(),D=i("p"),D.innerHTML=Ze,ue=s(),c(R.$$.fragment),fe=s(),d=i("div"),c(V.$$.fragment),ke=s(),H=i("p"),H.textContent=Ge,Te=s(),q=i("p"),q.innerHTML=Ee,Le=s(),S=i("p"),S.innerHTML=De,Je=s(),J=i("div"),c(I.$$.fragment),je=s(),z=i("p"),z.textContent=Re,$e=s(),c(j.$$.fragment),he=s(),c(P.$$.fragment),ge=s(),W=i("div"),c(Q.$$.fragment),be=s(),c(X.$$.fragment),Me=s(),O=i("p"),this.h()},l(e){const t=He("svelte-u9bgzb",document.head);p=r(t,"META",{name:!0,content:!0}),t.forEach(n),$=a(e),L=r(e,"P",{}),K(L).forEach(n),b=a(e),m(M.$$.fragment,e),o=a(e),m(T.$$.fragment,e),ne=a(e),w=r(e,"P",{"data-svelte-h":!0}),k(w)!=="svelte-iy97jd"&&(w.innerHTML=Ue),le=a(e),m(v.$$.fragment,e),se=a(e),m(U.$$.fragment,e),ae=a(e),m(x.$$.fragment,e),oe=a(e),A=r(e,"P",{"data-svelte-h":!0}),k(A)!=="svelte-oj3ayu"&&(A.innerHTML=xe),ie=a(e),m(N.$$.fragment,e),re=a(e),m(C.$$.fragment,e),pe=a(e),B=r(e,"P",{"data-svelte-h":!0}),k(B)!=="svelte-dyckw0"&&(B.textContent=Ae),de=a(e),Z=r(e,"TABLE",{"data-svelte-h":!0}),k(Z)!=="svelte-1rivae1"&&(Z.innerHTML=Ne),ce=a(e),G=r(e,"P",{"data-svelte-h":!0}),k(G)!=="svelte-j0510o"&&(G.innerHTML=Ce),me=a(e),E=r(e,"P",{"data-svelte-h":!0}),k(E)!=="svelte-1qsx12h"&&(E.innerHTML=Be),_e=a(e),D=r(e,"P",{"data-svelte-h":!0}),k(D)!=="svelte-1xv5tng"&&(D.innerHTML=Ze),ue=a(e),m(R.$$.fragment,e),fe=a(e),d=r(e,"DIV",{class:!0});var g=K(d);m(V.$$.fragment,g),ke=a(g),H=r(g,"P",{"data-svelte-h":!0}),k(H)!=="svelte-tphs8a"&&(H.textContent=Ge),Te=a(g),q=r(g,"P",{"data-svelte-h":!0}),k(q)!=="svelte-1ierb4m"&&(q.innerHTML=Ee),Le=a(g),S=r(g,"P",{"data-svelte-h":!0}),k(S)!=="svelte-1prelxv"&&(S.innerHTML=De),Je=a(g),J=r(g,"DIV",{class:!0});var F=K(J);m(I.$$.fragment,F),je=a(F),z=r(F,"P",{"data-svelte-h":!0}),k(z)!=="svelte-18pcj9j"&&(z.textContent=Re),$e=a(F),m(j.$$.fragment,F),F.forEach(n),g.forEach(n),he=a(e),m(P.$$.fragment,e),ge=a(e),W=r(e,"DIV",{class:!0});var Ve=K(W);m(Q.$$.fragment,Ve),Ve.forEach(n),be=a(e),m(X.$$.fragment,e),Me=a(e),O=r(e,"P",{}),K(O).forEach(n),this.h()},h(){ee(p,"name","hf:doc:metadata"),ee(p,"content",Oe),ee(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ee(W,"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,t){y(document.head,p),l(e,$,t),l(e,L,t),l(e,b,t),_(M,e,t),l(e,o,t),_(T,e,t),l(e,ne,t),l(e,w,t),l(e,le,t),_(v,e,t),l(e,se,t),_(U,e,t),l(e,ae,t),_(x,e,t),l(e,oe,t),l(e,A,t),l(e,ie,t),_(N,e,t),l(e,re,t),_(C,e,t),l(e,pe,t),l(e,B,t),l(e,de,t),l(e,Z,t),l(e,ce,t),l(e,G,t),l(e,me,t),l(e,E,t),l(e,_e,t),l(e,D,t),l(e,ue,t),_(R,e,t),l(e,fe,t),l(e,d,t),_(V,d,null),y(d,ke),y(d,H),y(d,Te),y(d,q),y(d,Le),y(d,S),y(d,Je),y(d,J),_(I,J,null),y(J,je),y(J,z),y(J,$e),_(j,J,null),l(e,he,t),_(P,e,t),l(e,ge,t),l(e,W,t),_(Q,W,null),l(e,be,t),_(X,e,t),l(e,Me,t),l(e,O,t),ye=!0},p(e,[t]){const g={};t&2&&(g.$$scope={dirty:t,ctx:e}),j.$set(g)},i(e){ye||(u(M.$$.fragment,e),u(T.$$.fragment,e),u(v.$$.fragment,e),u(U.$$.fragment,e),u(x.$$.fragment,e),u(N.$$.fragment,e),u(C.$$.fragment,e),u(R.$$.fragment,e),u(V.$$.fragment,e),u(I.$$.fragment,e),u(j.$$.fragment,e),u(P.$$.fragment,e),u(Q.$$.fragment,e),u(X.$$.fragment,e),ye=!0)},o(e){f(M.$$.fragment,e),f(T.$$.fragment,e),f(v.$$.fragment,e),f(U.$$.fragment,e),f(x.$$.fragment,e),f(N.$$.fragment,e),f(C.$$.fragment,e),f(R.$$.fragment,e),f(V.$$.fragment,e),f(I.$$.fragment,e),f(j.$$.fragment,e),f(P.$$.fragment,e),f(Q.$$.fragment,e),f(X.$$.fragment,e),ye=!1},d(e){e&&(n($),n(L),n(b),n(o),n(ne),n(w),n(le),n(se),n(ae),n(oe),n(A),n(ie),n(re),n(pe),n(B),n(de),n(Z),n(ce),n(G),n(me),n(E),n(_e),n(D),n(ue),n(fe),n(d),n(he),n(ge),n(W),n(be),n(Me),n(O)),n(p),h(M,e),h(T,e),h(v,e),h(U,e),h(x,e),h(N,e),h(C,e),h(R,e),h(V),h(I),h(j),h(P,e),h(Q),h(X,e)}}}const Oe='{"title":"LLaDA2","local":"llada2","sections":[{"title":"Usage","local":"usage","sections":[],"depth":2},{"title":"Callbacks","local":"callbacks","sections":[],"depth":2},{"title":"Recommended parameters","local":"recommended-parameters","sections":[],"depth":2},{"title":"LLaDA2Pipeline","local":"diffusers.LLaDA2Pipeline","sections":[],"depth":2},{"title":"LLaDA2PipelineOutput","local":"diffusers.LLaDA2PipelineOutput","sections":[],"depth":2}],"depth":1}';function Ke(te){return Pe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class it extends Qe{constructor(p){super(),Xe(this,p,Ke,Ye,Ie,{})}}export{it as component};

Xet Storage Details

Size:
24.3 kB
·
Xet hash:
4c840696cdb98dae963b677b100f510ea0bb6ccacf47a0b7c507a227e1e72ab1

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.