Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
izellevy committed Feb 1, 2024
1 parent 45b7c23 commit 5025e16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pinecone_text/dense/openai_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def __init__(
"`pip install pinecone-text[openai]"
)
super().__init__()

assert dimension > 0, "dimension must be a positive integer"
self._model_name = model_name
self._dimension = dimension
self._client = self._create_client(**kwargs)
Expand Down Expand Up @@ -85,7 +87,6 @@ def _encode(
model=self._model_name,
)
if self._dimension is not None:
assert self._dimension > 0, "dimension must be a positive integer"
params["dimensions"] = self._dimension
response = self._client.embeddings.create(**params)
except OpenAIError as e:
Expand Down

0 comments on commit 5025e16

Please sign in to comment.