Skip to content

Commit

Permalink
fix: DalleBartProcessor.__call__ type signature (#271)
Browse files Browse the repository at this point in the history
Fix contradictory type signature...
`text: str` and assert not `isinstance(text, str), ...`
`text` should be treated as a list of strings.
  • Loading branch information
jon-edward authored Jun 22, 2022
1 parent 5ee4579 commit e64936e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dalle_mini/model/processor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
""" DalleBart processor """

from typing import List

import jax.numpy as jnp

from .configuration import DalleBartConfig
Expand Down Expand Up @@ -28,7 +30,7 @@ def __init__(
self.input_ids_uncond = uncond["input_ids"]
self.attention_mask_uncond = uncond["attention_mask"]

def __call__(self, text: str = None):
def __call__(self, text: List[str] = None):
# check that text is not a string
assert not isinstance(text, str), "text must be a list of strings"

Expand Down

0 comments on commit e64936e

Please sign in to comment.