update readme

Former-commit-id: 1b1b427ea13d2a84683514d924555db974865d73
This commit is contained in:
hiyouga
2024-02-26 17:25:47 +08:00
parent 9cde56d760
commit 4b06aa134f
9 changed files with 37 additions and 36 deletions

View File

@@ -75,7 +75,8 @@ class Formatter(ABC):
tool_format: Literal["default"] = "default"
@abstractmethod
def apply(self, **kwargs) -> SLOTS: ...
def apply(self, **kwargs) -> SLOTS:
...
def extract(self, content: str) -> Union[str, Tuple[str, str]]:
raise NotImplementedError

View File

@@ -308,6 +308,15 @@ _register_template(
)
_register_template(
name="atom",
format_user=StringFormatter(
slots=[{"bos_token"}, "Human: {{content}}\n", {"eos_token"}, {"bos_token"}, "Assistant:"]
),
format_assistant=StringFormatter(slots=["{{content}}\n", {"eos_token"}]),
)
_register_template(
name="baichuan",
format_user=StringFormatter(slots=[{"token": "<reserved_102>"}, "{{content}}", {"token": "<reserved_103>"}]),
@@ -515,7 +524,7 @@ _register_template(
_register_template(
name="openchat",
format_user=StringFormatter(slots=["GPT4 Correct User: {{content}}", {"eos_token"}, "GPT4 Correct Assistant:"]),
format_assistant=StringFormatter(slots=["{{content}}"]),
format_assistant=StringFormatter(slots=["{{content}}", {"eos_token"}]),
format_system=StringFormatter(slots=[{"bos_token"}, "{{content}}"]),
force_system=True,
)
@@ -644,9 +653,3 @@ _register_template(
format_user=StringFormatter(slots=[{"token": "<human>"}, ":{{content}}\n", {"token": "<bot>"}, ":"]),
format_separator=EmptyFormatter(slots=["\n"]),
)
_register_template(
name="atom",
format_user=StringFormatter(slots=[{"bos_token"}, "Human: {{content}}\n", {"eos_token"}, {"bos_token"}, "Assistant:"]),
format_assistant=StringFormatter(slots=["{{content}}\n", {"eos_token"}]),
)

View File

@@ -884,6 +884,7 @@ register_model_group(
template="zephyr",
)
register_model_group(
models={
"Atom-7B": {

View File

@@ -34,9 +34,7 @@ def create_top() -> Dict[str, "Component"]:
model_name.change(list_adapters, [model_name, finetuning_type], [adapter_path], queue=False).then(
get_model_path, [model_name], [model_path], queue=False
).then(
get_template, [model_name], [template], queue=False
) # do not save config since the below line will save
).then(get_template, [model_name], [template], queue=False) # do not save config since the below line will save
model_path.change(save_config, inputs=[lang, model_name, model_path], queue=False)