MCPcopy Create free account

hub / github.com/Hunyuan-PromptEnhancer/PromptEnhancer / functions

Functions38 in github.com/Hunyuan-PromptEnhancer/PromptEnhancer

↓ 3 callersFunctionprocess_vision_info
(messages)
inference/app.py:17
↓ 2 callersFunctionensure_enhancer
state: dict or None Returns: (state_dict)
inference/app.py:120
↓ 2 callersMethodpredict
Generate a rewritten prompt using the model. Args: prompt_cot (str): The original prompt to be rewritten. sy
inference/prompt_enhancer_v2.py:50
↓ 2 callersMethodpredict
( self, prompt_cot, sys_prompt="请根据用户的输入,生成思考过程的思维链并改写提示词:", temperature=0.0,
inference/app.py:49
↓ 2 callersFunctionprocess_vision_info
(messages)
inference/app_stream.py:19
↓ 2 callersFunctionreplace_single_quotes
(text)
inference/app_stream.py:22
↓ 1 callersFunction_load_image_bytes
Return ``(raw_bytes, mime_type)`` for a remote URL or a local file path.
t2i_keypoints_eval.py:62
↓ 1 callersFunctionbuild_instruction
Build the judge instruction for a single key point.
t2i_keypoints_eval.py:160
↓ 1 callersFunctionensure_enhancer
state: dict or None Returns: (state_dict)
inference/app_stream.py:204
↓ 1 callersFunctioneval_sample
Run the full pipeline for one benchmark sample and attach the scores.
t2i_keypoints_eval.py:180
↓ 1 callersMethodget_model_info
Get information about the loaded model.
inference/prompt_enhancer_gguf.py:143
↓ 1 callersFunctionmain
()
t2i_keypoints_eval.py:268
↓ 1 callersFunctionparse_args
()
t2i_keypoints_eval.py:236
↓ 1 callersFunctionparse_verdict
Map a judge response to 1 (accept) or 0 (reject). The judge is asked to reason first and state its verdict last, so we use the last occurrenc
t2i_keypoints_eval.py:121
↓ 1 callersMethodpredict
Generate enhanced editing prompt based on input image and instruction. Args: edit_instruction (str): Original editing in
inference/prompt_enhancer_img2img.py:66
↓ 1 callersMethodpredict
Generate a rewritten prompt using the GGUF model. Args: prompt_cot (str): The original prompt to be rewritten.
inference/prompt_enhancer_gguf.py:78
↓ 1 callersMethodpredict
Generate a rewritten prompt using the model. Args: prompt_cot (str): The original prompt to be rewritten. sy
inference/prompt_enhancer.py:49
↓ 1 callersMethodpredict_stream
( self, prompt_cot, sys_prompt="请根据用户的输入,生成思考过程的思维链并改写提示词:", temperature=0.1,
inference/app_stream.py:115
↓ 1 callersFunctionprompt_enhancer
Enhance a raw prompt. Replace with your own enhancer.
t2i_keypoints_eval.py:140
↓ 1 callersFunctionreplace_single_quotes
Replace single quotes within words with double quotes, and convert curly single quotes to curly double quotes for consistency.
inference/prompt_enhancer_gguf.py:22
↓ 1 callersFunctionreplace_single_quotes
Replace single quotes within words with double quotes, and convert curly single quotes to curly double quotes for consistency.
inference/prompt_enhancer_v2.py:15
↓ 1 callersFunctionreplace_single_quotes
Replace single quotes within words with double quotes, and convert curly single quotes to curly double quotes for consistency.
inference/prompt_enhancer.py:14
↓ 1 callersFunctionreplace_single_quotes
(text)
inference/app.py:20
↓ 1 callersFunctionreport
Print and return per-key-point accuracy plus the all-points-correct ratio.
t2i_keypoints_eval.py:202
↓ 1 callersFunctiontext_to_image
Generate an image for ``prompt`` and return a URL or local file path. Replace this with a call to your text-to-image model. The returned value is
t2i_keypoints_eval.py:145
↓ 1 callersFunctionwrite_json
(data, path: str, encoding: str = "utf-8")
t2i_keypoints_eval.py:54
Method__call__
Return the judge's raw text response, or ``None`` if all retries fail.
t2i_keypoints_eval.py:102
Method__init__
( self, model: str = "gemini-2.5-pro", api_key: Optional[str] = None, max_retr
t2i_keypoints_eval.py:78
Method__init__
(self, models_root_path, device_map="atuo", torch_dtype="bfloat16")
inference/app_stream.py:29
Method__init__
Initialize the Image-to-Image Prompt Enhancer. Args: model_path (str): Path to the pretrained Qwen2.5-VL model.
inference/prompt_enhancer_img2img.py:35
Method__init__
Initialize the PromptEnhancerGGUF class with GGUF model. Args: model_path (str): Path to the GGUF model file.
inference/prompt_enhancer_gguf.py:35
Method__init__
Initialize the PromptEnhancerV2 class with model and processor. Args: models_root_path (str): Path to the pretrained mod
inference/prompt_enhancer_v2.py:28
Method__init__
Initialize the HunyuanPromptEnhancer class with model and processor. Args: models_root_path (str): Path to the pretraine
inference/prompt_enhancer.py:28
Method__init__
(self, models_root_path, device_map="auto", torch_dtype="bfloat16")
inference/app.py:27
Methodpredict
( self, prompt_cot, sys_prompt="请根据用户的输入,生成思考过程的思维链并改写提示词:", temperature=0.0,
inference/app_stream.py:51
Functionrun_batch
batch_text: 多行文本,每行一个提示词
inference/app.py:161
Functionrun_single
(prompt, sys_prompt, temperature, max_new_tokens, device, model_path, device_map, torch_dtype,
inference/app.py:140
Functionstream_single
(prompt, sys_prompt, temperature, max_new_tokens, device, model_path, device_map, torch_dtyp
inference/app_stream.py:224