From 59a8d39a9246be82f24615aadd96be21e17d76b9 Mon Sep 17 00:00:00 2001 From: Jon Durbin Date: Tue, 18 Jul 2023 14:10:30 -0400 Subject: [PATCH] Misc fixes/missing instructors. --- airoboros/instructors/agent.py | 7 +++++++ airoboros/instructors/cot.py | 7 +++++++ airoboros/self_instruct.py | 2 +- setup.py | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 airoboros/instructors/agent.py create mode 100644 airoboros/instructors/cot.py diff --git a/airoboros/instructors/agent.py b/airoboros/instructors/agent.py new file mode 100644 index 0000000..5ce05b5 --- /dev/null +++ b/airoboros/instructors/agent.py @@ -0,0 +1,7 @@ +from airoboros.instructors.inline_qa import generate as generate_inline + + +async def generate(instructor): + """Generator for agent/router training data.""" + async for item in generate_inline(instructor, "agent", start_key="PROMPT"): + yield item diff --git a/airoboros/instructors/cot.py b/airoboros/instructors/cot.py new file mode 100644 index 0000000..4f51faf --- /dev/null +++ b/airoboros/instructors/cot.py @@ -0,0 +1,7 @@ +from airoboros.instructors.inline_qa import generate as generate_inline + + +async def generate(instructor): + """Generator for chain-of-thought training data.""" + async for item in generate_inline(instructor, "cot"): + yield item diff --git a/airoboros/self_instruct.py b/airoboros/self_instruct.py index 4990fda..0389ddd 100644 --- a/airoboros/self_instruct.py +++ b/airoboros/self_instruct.py @@ -319,7 +319,7 @@ async def _post(self, path: str, payload: Dict[str, Any]) -> Dict[str, Any]: logger.debug(f"token usage: {self.used_tokens}") return result - async def _post_no_exc(self, *a, **k) -> Dict[str, Any] | None: + async def _post_no_exc(self, *a, **k): """Post, ignoring all exceptions.""" try: return await self._post(*a, **k) diff --git a/setup.py b/setup.py index 419a93f..1d48d55 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="airoboros", - version="2.0.0", + version="2.0.1", description="Updated and improved implementation of the self-instruct system.", long_description=long_description, long_description_content_type="text/markdown",