MCPcopy Create free account
hub / github.com/huggingface/diffusers / main

Function main

examples/discrete_diffusion/sample_llada2.py:36–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35
36def main():
37 parser = argparse.ArgumentParser(
38 description="Generate text using LLaDA2Pipeline with block-wise discrete diffusion."
39 )
40 parser.add_argument(
41 "--model_id",
42 type=str,
43 default="inclusionAI/LLaDA2.0-mini",
44 help="HuggingFace model ID or path to local model.",
45 )
46 parser.add_argument(
47 "--prompt",
48 type=str,
49 default="Why does Camus think that Sisyphus is happy?",
50 help="Text prompt to generate from.",
51 )
52 parser.add_argument(
53 "--gen_length",
54 type=int,
55 default=2048,
56 help="Number of tokens to generate.",
57 )
58 parser.add_argument(
59 "--block_length",
60 type=int,
61 default=32,
62 help="Size of each generation block.",
63 )
64 parser.add_argument(
65 "--num_inference_steps",
66 type=int,
67 default=32,
68 help="Number of refinement steps per block.",
69 )
70 parser.add_argument(
71 "--temperature",
72 type=float,
73 default=0.0,
74 help="Sampling temperature (0.0 for greedy).",
75 )
76 parser.add_argument(
77 "--top_p",
78 type=float,
79 default=None,
80 help="Nucleus sampling probability threshold.",
81 )
82 parser.add_argument(
83 "--top_k",
84 type=int,
85 default=None,
86 help="Top-k sampling parameter.",
87 )
88 parser.add_argument(
89 "--threshold",
90 type=float,
91 default=0.95,
92 help="Confidence threshold for committing tokens.",
93 )

Callers 1

sample_llada2.pyFile · 0.70

Calls 7

apply_group_offloadingFunction · 0.90
LLaDA2PipelineClass · 0.90
pipeFunction · 0.85
from_pretrainedMethod · 0.45
deviceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…