-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
91 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CHAT_ROLE_SYSTEM: str = "system" | ||
CHAT_ROLE_USER: str = "user" | ||
CHAT_ROLE_ASSISTANT: str = "assistant" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from ezpyai.dataset.chat.chat import DatasetChat | ||
from ezpyai.dataset.chat.dataset_chat import DatasetChat, DatasetChatEntry # type: ignore |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from typing import List | ||
|
||
|
||
class DatasetChatEntry: | ||
def __init__(self, role: str, content: str) -> None: | ||
self.role: str = role | ||
self.content: str = content | ||
|
||
def __str__(self) -> str: | ||
return f"{self.role}: {self.content}" | ||
|
||
|
||
class DatasetChat: | ||
def __init__(self, entries: List[DatasetChatEntry] | None = None) -> None: | ||
if entries is None: | ||
entries = [] | ||
|
||
self.entries: List[DatasetChatEntry] = entries | ||
|
||
def add_entry(self, role: str, content: str) -> None: | ||
self.entries.append(DatasetChatEntry(role=role, content=content)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from ezpyai.dataset.chat.sources.telegram import DatasetSourceTelegram | ||
from ezpyai.dataset.chat.sources.telegram import DatasetSourceTelegram # type: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import List | ||
|
||
from ezpyai.dataset.chat import DatasetChat | ||
|
||
|
||
class DatasetSource(ABC): | ||
@abstractmethod | ||
def to_dataset_chats(self, system_message_tpl: str) -> List[DatasetChat]: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters