add tool hint

Former-commit-id: 64734ffe2f45f80a1e33c2a72330b2ab1e58feb3
This commit is contained in:
hiyouga
2024-01-18 13:19:09 +08:00
parent b7df920860
commit 502f84b30c
2 changed files with 12 additions and 0 deletions

View File

@@ -41,6 +41,13 @@ def can_quantize(finetuning_type: str) -> Dict[str, Any]:
return gr.update(interactive=True)
def check_json_schema(text: str) -> None:
try:
json.loads(text)
except json.JSONDecodeError:
gr.Warning("Invalid JSON schema")
def gen_cmd(args: Dict[str, Any]) -> str:
args.pop("disable_tqdm", None)
args["plot_loss"] = args.get("do_train", None)