初始化项目,由ModelHub XC社区提供模型
Model: ericoh929/qwen3-1.7b-lamini-qlora-instruction-tuned Source: Original Platform
This commit is contained in:
21
prompt_format.py
Normal file
21
prompt_format.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# prompt_format.py
|
||||
from __future__ import annotations
|
||||
|
||||
RESPONSE_TAG = "### Response:"
|
||||
|
||||
|
||||
def format_instruction_prompt(instruction: str, inp: str | None = None) -> str:
|
||||
instruction = (instruction or "").strip()
|
||||
inp = (inp or "").strip() if inp is not None else ""
|
||||
|
||||
if inp:
|
||||
return (
|
||||
f"### Instruction:\n{instruction}\n\n"
|
||||
f"### Input:\n{inp}\n\n"
|
||||
f"{RESPONSE_TAG}\n"
|
||||
)
|
||||
else:
|
||||
return (
|
||||
f"### Instruction:\n{instruction}\n\n"
|
||||
f"{RESPONSE_TAG}\n"
|
||||
)
|
||||
Reference in New Issue
Block a user