Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #79 from premAI-io/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl authored Aug 1, 2023
2 parents eb075c9 + e30ffb9 commit 8e4e2a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ repos:
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
args: [-j8]
additional_dependencies:
- flake8-broken-line
- flake8-bugbear
Expand Down
2 changes: 1 addition & 1 deletion ebd-all-minilm/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def embeddings(body: EmbeddingsInput):
"/engines/text-embedding-ada-002/embeddings", response_model=EmbeddingsResponse
)
async def embeddings_openai(body: EmbeddingsInput):
if len(body.input) > 0 and type(body.input[0]) == list:
if len(body.input) > 0 and isinstance(body.input[0], list):
encoding = tiktoken.model.encoding_for_model("text-embedding-ada-002")
texts = encoding.decode_batch(body.input)
else:
Expand Down

0 comments on commit 8e4e2a3

Please sign in to comment.