Skip to content

Commit

Permalink
Fix mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
amrit110 committed Oct 22, 2024
1 parent 3b1f456 commit c9e024c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions health_rec/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from typing import Any, Dict, List, Optional, Tuple

import chromadb
import numpy as np
import openai
from chromadb.api.types import Documents, EmbeddingFunction, Embeddings

Expand Down Expand Up @@ -46,9 +45,7 @@ def __call__(self, texts: Documents) -> Embeddings:
"""
try:
response = self.client.embeddings.create(input=texts, model=self.model)
return [
np.array(data.embedding, dtype=np.float32) for data in response.data
]
return [data.embedding for data in response.data]
except Exception as e:
logger.error(f"Error generating embeddings: {e}")
raise
Expand Down

0 comments on commit c9e024c

Please sign in to comment.