Skip to content

Commit

Permalink
fix: pyright errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zanussbaum committed Jun 17, 2024
1 parent 8983981 commit e707f94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nomic/atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def map_data(
modality = "image"
indexed_field = "_blob_hash"
if embedding_model is not None:
if embedding_model.model in ["nomic-embed-text-v1", "nomic-embed-text-v1.5"]:
model_name = embedding_model if isinstance(embedding_model, str) else embedding_model.model
if model_name in ["nomic-embed-text-v1", "nomic-embed-text-v1.5"]:
raise Exception("You cannot use a text embedding model with blobs")
else:
# default to vision v1.5
Expand Down
4 changes: 2 additions & 2 deletions nomic/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ def _add_blobs(
# add hash to data as _blob_hash
# set indexed_field to _blob_hash
# call _add_data
ids = data[self.id_field].to_pylist()
ids = data[self.id_field].to_pylist() # type: ignore
# TODO: add support for other modalities
images = []
for uuid, blob in tqdm(zip(ids, blobs), total=len(ids), desc="Processing blobs"):
Expand Down Expand Up @@ -1502,7 +1502,7 @@ def send_request(i):
del futures[future]

hash_tb = pa.Table.from_pydict({"id": returned_ids, "_blob_hash": returned_hashes}, schema=hash_schema)
merged_data = data.join(right_table=hash_tb, keys="id")
merged_data = data.join(right_table=hash_tb, keys="id") # type: ignore

self._add_data(merged_data, pbar=pbar)

Expand Down

0 comments on commit e707f94

Please sign in to comment.