nomic 3.1.2__tar.gz → 3.1.3__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.

Potentially problematic release.


This version of nomic might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nomic
3
- Version: 3.1.2
3
+ Version: 3.1.3
4
4
  Summary: The official Nomic python client.
5
5
  Home-page: https://github.com/nomic-ai/nomic
6
6
  Author: nomic.ai
@@ -38,26 +38,6 @@ def parse_sagemaker_response(response):
38
38
  return resp["embeddings"]
39
39
 
40
40
 
41
- def preprocess_texts(texts: List[str], task_type: str = "search_document"):
42
- """
43
- Preprocess a list of texts for embedding using a sagemaker model.
44
-
45
- Args:
46
- texts: List of texts to be embedded.
47
- task_type: The task type to use when embedding. One of `search_query`, `search_document`, `classification`, `clustering`
48
-
49
- Returns:
50
- List of texts formatted for sagemaker embedding.
51
- """
52
- assert task_type in [
53
- "search_query",
54
- "search_document",
55
- "classification",
56
- "clustering",
57
- ], f"Invalid task type: {task_type}"
58
- return [f"{task_type}: {text}" for text in texts]
59
-
60
-
61
41
  def batch_transform_text(
62
42
  s3_input_path: str,
63
43
  s3_output_path: str,
@@ -157,7 +137,13 @@ def embed_text(
157
137
  logger.warning("No texts to embed.")
158
138
  return None
159
139
 
160
- texts = preprocess_texts(texts, task_type)
140
+ assert task_type in [
141
+ "search_query",
142
+ "search_document",
143
+ "classification",
144
+ "clustering",
145
+ ], f"Invalid task type: {task_type}"
146
+
161
147
  assert dimensionality in (
162
148
  64,
163
149
  128,
@@ -175,6 +161,7 @@ def embed_text(
175
161
  "texts": texts[i : i + batch_size],
176
162
  "binary": binary,
177
163
  "dimensionality": dimensionality,
164
+ "task_type": task_type,
178
165
  }
179
166
  )
180
167
  response = client.invoke_endpoint(EndpointName=sagemaker_endpoint, Body=batch, ContentType="application/json")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nomic
3
- Version: 3.1.2
3
+ Version: 3.1.3
4
4
  Summary: The official Nomic python client.
5
5
  Home-page: https://github.com/nomic-ai/nomic
6
6
  Author: nomic.ai
@@ -25,7 +25,7 @@ coverage
25
25
  pylint
26
26
  pytest
27
27
  isort
28
- pyright
28
+ pyright<=1.1.377
29
29
  myst-parser
30
30
  mkdocs-material
31
31
  mkautodoc
@@ -8,7 +8,7 @@ description = "The official Nomic python client."
8
8
 
9
9
  setup(
10
10
  name="nomic",
11
- version="3.1.2",
11
+ version="3.1.3",
12
12
  url="https://github.com/nomic-ai/nomic",
13
13
  description=description,
14
14
  long_description=description,
@@ -48,7 +48,7 @@ setup(
48
48
  "pylint",
49
49
  "pytest",
50
50
  "isort",
51
- "pyright",
51
+ "pyright<=1.1.377",
52
52
  "myst-parser",
53
53
  "mkdocs-material",
54
54
  "mkautodoc",
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