Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,8 @@ logging.getLogger("httpx").setLevel(logging.WARNING)
|
|
21 |
|
22 |
import gradio as gr
|
23 |
|
24 |
-
from conversation import default_conversation, conv_templates, SeparatorStyle
|
|
|
25 |
|
26 |
# --- Global Variables and Model Loading ---
|
27 |
model = None # Global variable to hold the loaded ILLUME model
|
@@ -569,8 +570,9 @@ title_markdown = """
|
|
569 |
<li><strong>3.</strong> Click the 🖼️ <strong>Generate</strong> for image generation and image editing.</li>
|
570 |
<li><strong>5.</strong> (Optional) Enable Diffusion Decoder for image super resolution decoding.
|
571 |
<li><strong>4.</strong> Adjust generation parameters if needed.
|
572 |
-
<br/><strong>💡 Tip 1:</strong> For better image generation quality, we recommend setting <code>top_k = 2048</code>.
|
573 |
-
<br/><strong>💡 Tip 2:</strong> For
|
|
|
574 |
</li>
|
575 |
</ul>
|
576 |
</div>
|
@@ -897,15 +899,15 @@ def build_demo(embed_mode):
|
|
897 |
if __name__ == "__main__":
|
898 |
parser = argparse.ArgumentParser()
|
899 |
# --- Add arguments for ILLUME configs and checkpoints ---
|
900 |
-
parser.add_argument("--model_name", type=str, default="
|
901 |
help="Name for builder.")
|
902 |
-
parser.add_argument("--torch_dtype", type=str, default='
|
903 |
help="Computation data type.")
|
904 |
|
905 |
-
parser.add_argument("--diffusion_decoder_path", type=str, default='
|
906 |
-
help="Path to Diffusion Decoder checkpoint
|
907 |
|
908 |
-
parser.add_argument("--tokenizer_path", type=str, default='
|
909 |
help="Path to Tokenizer config file (e.g., tokenizer_config.py).")
|
910 |
|
911 |
# --- End ILLUME arguments ---
|
|
|
21 |
|
22 |
import gradio as gr
|
23 |
|
24 |
+
from illume.conversation import default_conversation, conv_templates, SeparatorStyle
|
25 |
+
# from conversation import default_conversation, conv_templates, SeparatorStyle
|
26 |
|
27 |
# --- Global Variables and Model Loading ---
|
28 |
model = None # Global variable to hold the loaded ILLUME model
|
|
|
570 |
<li><strong>3.</strong> Click the 🖼️ <strong>Generate</strong> for image generation and image editing.</li>
|
571 |
<li><strong>5.</strong> (Optional) Enable Diffusion Decoder for image super resolution decoding.
|
572 |
<li><strong>4.</strong> Adjust generation parameters if needed.
|
573 |
+
<br/><strong>💡 Tip 1:</strong> For better image generation quality, we recommend setting <code>temperature = 1.0</code>, <code>top_k = 2048</code>, <code>top_p = 1.0</code>, <code>llm_cfg = 2.0</code>.
|
574 |
+
<br/><strong>💡 Tip 2:</strong> For better image editing quality, we recommend setting <code>temperature = 0.7</code>, <code>top_k = 512</code>, <code>top_p = 0.8</code>, <code>llm_cfg = 1.5</code>.
|
575 |
+
<br/><strong>💡 Tip 3:</strong> For diffusion decoder, CFG scale of 1.5 or 2.0 is enough.
|
576 |
</li>
|
577 |
</ul>
|
578 |
</div>
|
|
|
899 |
if __name__ == "__main__":
|
900 |
parser = argparse.ArgumentParser()
|
901 |
# --- Add arguments for ILLUME configs and checkpoints ---
|
902 |
+
parser.add_argument("--model_name", type=str, default="ILLUME-MLLM/illume_plus-qwen-2_5-3b-hf",
|
903 |
help="Name for builder.")
|
904 |
+
parser.add_argument("--torch_dtype", type=str, default='bf16', choices=['fp32', 'bf16', 'fp16'],
|
905 |
help="Computation data type.")
|
906 |
|
907 |
+
parser.add_argument("--diffusion_decoder_path", type=str, default='ILLUME-MLLM/dualvitok_sdxl_decoder',
|
908 |
+
help="Path to Diffusion Decoder checkpoint. Required if using diffusion.")
|
909 |
|
910 |
+
parser.add_argument("--tokenizer_path", type=str, default='ILLUME-MLLM/dualvitok',
|
911 |
help="Path to Tokenizer config file (e.g., tokenizer_config.py).")
|
912 |
|
913 |
# --- End ILLUME arguments ---
|