seekrai 0.3.3__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {seekrai-0.3.3 → seekrai-0.4.2}/PKG-INFO +1 -1
- {seekrai-0.3.3 → seekrai-0.4.2}/pyproject.toml +1 -1
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/filemanager.py +7 -7
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/alignment.py +5 -4
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/chat/completions.py +2 -3
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/__init__.py +2 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/alignment.py +11 -1
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/deployments.py +1 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/finetune.py +1 -0
- seekrai-0.4.2/src/seekrai/types/ingestion.py +8 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/utils/files.py +2 -2
- {seekrai-0.3.3 → seekrai-0.4.2}/LICENSE +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/README.md +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/__init__.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/abstract/__init__.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/abstract/api_requestor.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/client.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/constants.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/error.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/__init__.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/chat/__init__.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/completions.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/deployments.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/embeddings.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/files.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/finetune.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/images.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/models.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/resources/projects.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/seekrflow_response.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/abstract.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/chat_completions.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/common.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/completions.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/embeddings.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/error.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/files.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/images.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/models.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/types/projects.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/utils/__init__.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/utils/_log.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/utils/api_helpers.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/utils/tools.py +0 -0
- {seekrai-0.3.3 → seekrai-0.4.2}/src/seekrai/version.py +0 -0
|
@@ -91,10 +91,9 @@ def _prepare_output(
|
|
|
91
91
|
|
|
92
92
|
content_type = str(headers.get("content-type"))
|
|
93
93
|
|
|
94
|
-
assert
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
)
|
|
94
|
+
assert (
|
|
95
|
+
remote_name
|
|
96
|
+
), "No model name found in fine_tune object. Please specify an `output` file name."
|
|
98
97
|
|
|
99
98
|
if step > 0:
|
|
100
99
|
remote_name += f"-checkpoint-{step}"
|
|
@@ -193,7 +192,7 @@ class DownloadManager:
|
|
|
193
192
|
method="GET",
|
|
194
193
|
url=url,
|
|
195
194
|
),
|
|
196
|
-
stream=
|
|
195
|
+
stream=False,
|
|
197
196
|
)
|
|
198
197
|
|
|
199
198
|
try:
|
|
@@ -222,9 +221,10 @@ class DownloadManager:
|
|
|
222
221
|
num_bytes_downloaded = response.num_bytes_downloaded
|
|
223
222
|
|
|
224
223
|
# Raise exception if remote file size does not match downloaded file size
|
|
225
|
-
|
|
224
|
+
temp_file_size = os.stat(temp_file.name).st_size
|
|
225
|
+
if temp_file_size != file_size:
|
|
226
226
|
DownloadError(
|
|
227
|
-
f"Downloaded file size `{
|
|
227
|
+
f"Downloaded file size `{temp_file_size}` bytes does not match "
|
|
228
228
|
f"remote file size `{file_size}` bytes."
|
|
229
229
|
)
|
|
230
230
|
|
|
@@ -8,6 +8,7 @@ from seekrai.types import (
|
|
|
8
8
|
AlignmentList,
|
|
9
9
|
AlignmentRequest,
|
|
10
10
|
AlignmentResponse,
|
|
11
|
+
AlignmentType,
|
|
11
12
|
SeekrFlowClient,
|
|
12
13
|
SeekrFlowRequest,
|
|
13
14
|
)
|
|
@@ -21,14 +22,14 @@ class Alignment:
|
|
|
21
22
|
self,
|
|
22
23
|
instructions: str,
|
|
23
24
|
files: List[str],
|
|
25
|
+
type: AlignmentType = AlignmentType.PRINCIPLE,
|
|
24
26
|
) -> AlignmentResponse:
|
|
25
27
|
requestor = api_requestor.APIRequestor(
|
|
26
28
|
client=self._client,
|
|
27
29
|
)
|
|
28
30
|
|
|
29
31
|
parameter_payload = AlignmentRequest(
|
|
30
|
-
instructions=instructions,
|
|
31
|
-
files=files,
|
|
32
|
+
instructions=instructions, files=files, type=type
|
|
32
33
|
).model_dump()
|
|
33
34
|
|
|
34
35
|
response, _, _ = requestor.request(
|
|
@@ -124,14 +125,14 @@ class AsyncAlignment:
|
|
|
124
125
|
self,
|
|
125
126
|
instructions: str,
|
|
126
127
|
files: List[str],
|
|
128
|
+
type: AlignmentType = AlignmentType.PRINCIPLE,
|
|
127
129
|
) -> AlignmentResponse:
|
|
128
130
|
requestor = api_requestor.APIRequestor(
|
|
129
131
|
client=self._client,
|
|
130
132
|
)
|
|
131
133
|
|
|
132
134
|
parameter_payload = AlignmentRequest(
|
|
133
|
-
instructions=instructions,
|
|
134
|
-
files=files,
|
|
135
|
+
instructions=instructions, files=files, type=type
|
|
135
136
|
).model_dump()
|
|
136
137
|
|
|
137
138
|
response, _, _ = await requestor.arequest(
|
|
@@ -35,7 +35,7 @@ class ChatCompletions:
|
|
|
35
35
|
n: int = 1,
|
|
36
36
|
safety_model: str | None = None,
|
|
37
37
|
response_format: Dict[str, str | Dict[str, Any]] | None = None,
|
|
38
|
-
tools: Dict[str, str | Dict[str, Any]] | None =
|
|
38
|
+
tools: Dict[str, str | Dict[str, Any]] | None = None,
|
|
39
39
|
tool_choice: str | Dict[str, str | Dict[str, str]] | None = "auto",
|
|
40
40
|
) -> ChatCompletionResponse | Iterator[ChatCompletionChunk]:
|
|
41
41
|
"""
|
|
@@ -89,7 +89,6 @@ class ChatCompletions:
|
|
|
89
89
|
ChatCompletionResponse | Iterator[ChatCompletionChunk]: Object containing the completions
|
|
90
90
|
or an iterator over completion chunks.
|
|
91
91
|
"""
|
|
92
|
-
|
|
93
92
|
requestor = api_requestor.APIRequestor(
|
|
94
93
|
client=self._client,
|
|
95
94
|
)
|
|
@@ -110,7 +109,7 @@ class ChatCompletions:
|
|
|
110
109
|
n=n,
|
|
111
110
|
safety_model=safety_model,
|
|
112
111
|
response_format=response_format,
|
|
113
|
-
tools=tools,
|
|
112
|
+
tools=tools or [],
|
|
114
113
|
tool_choice=tool_choice,
|
|
115
114
|
).model_dump()
|
|
116
115
|
|
|
@@ -6,6 +6,7 @@ from seekrai.types.alignment import (
|
|
|
6
6
|
AlignmentList,
|
|
7
7
|
AlignmentRequest,
|
|
8
8
|
AlignmentResponse,
|
|
9
|
+
AlignmentType,
|
|
9
10
|
)
|
|
10
11
|
from seekrai.types.chat_completions import (
|
|
11
12
|
ChatCompletionChunk,
|
|
@@ -94,6 +95,7 @@ __all__ = [
|
|
|
94
95
|
"AlignmentResponse",
|
|
95
96
|
"AlignmentJobStatus",
|
|
96
97
|
"AlignmentList",
|
|
98
|
+
"AlignmentType",
|
|
97
99
|
"Project",
|
|
98
100
|
"ProjectWithRuns",
|
|
99
101
|
"GetProjectsResponse",
|
|
@@ -9,6 +9,12 @@ from pydantic import Field
|
|
|
9
9
|
from seekrai.types.abstract import BaseModel
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
class AlignmentType(str, Enum):
|
|
13
|
+
PRINCIPLE = "principle"
|
|
14
|
+
CHAIN_OF_THOUGHT = "chain_of_thought"
|
|
15
|
+
RAFT = "raft"
|
|
16
|
+
|
|
17
|
+
|
|
12
18
|
class AlignmentRequest(BaseModel):
|
|
13
19
|
instructions: str = Field(
|
|
14
20
|
default=..., description="Task description/instructions for the alignment task"
|
|
@@ -16,12 +22,16 @@ class AlignmentRequest(BaseModel):
|
|
|
16
22
|
files: List[str] = Field(
|
|
17
23
|
default=..., description="List of file ids to use for alignment"
|
|
18
24
|
)
|
|
25
|
+
type: AlignmentType = Field(
|
|
26
|
+
default=AlignmentType.PRINCIPLE,
|
|
27
|
+
description="Type of alignment task (principle, chain_of_thought, or raft)",
|
|
28
|
+
)
|
|
19
29
|
|
|
20
30
|
|
|
21
31
|
class AlignmentEstimationRequest(BaseModel):
|
|
22
32
|
files: List[str] = Field(
|
|
23
33
|
default=...,
|
|
24
|
-
description="List of file ids to use to generate an alignment
|
|
34
|
+
description="List of file ids to use to generate an alignment estimate",
|
|
25
35
|
)
|
|
26
36
|
|
|
27
37
|
|
|
@@ -47,7 +47,7 @@ def check_file(
|
|
|
47
47
|
|
|
48
48
|
if file_size > MAX_FILE_SIZE_GB * NUM_BYTES_IN_GB:
|
|
49
49
|
report_dict["message"] = (
|
|
50
|
-
f"Maximum supported file size is {MAX_FILE_SIZE_GB} GB. Found file with size of {round(file_size / NUM_BYTES_IN_GB
|
|
50
|
+
f"Maximum supported file size is {MAX_FILE_SIZE_GB} GB. Found file with size of {round(file_size / NUM_BYTES_IN_GB, 3)} GB."
|
|
51
51
|
)
|
|
52
52
|
report_dict["is_check_passed"] = False
|
|
53
53
|
elif file_size == 0:
|
|
@@ -117,7 +117,7 @@ def _check_jsonl(file: Path) -> Dict[str, Any]:
|
|
|
117
117
|
report_dict["key_value"] = False
|
|
118
118
|
report_dict["message"] = (
|
|
119
119
|
f'Invalid value type for "text" key on line {idx + 1}. '
|
|
120
|
-
f
|
|
120
|
+
f"Expected string. Found {type(json_line['text'])}."
|
|
121
121
|
)
|
|
122
122
|
|
|
123
123
|
report_dict["is_check_passed"] = False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|