Upload processor_flamingo.py with huggingface_hub
Browse files- processor_flamingo.py +4 -1
processor_flamingo.py
CHANGED
@@ -38,7 +38,10 @@ class FlamingoProcessor(ProcessorMixin):
|
|
38 |
if type(text) == str:
|
39 |
all_text = "<image> " + text
|
40 |
else:
|
41 |
-
|
|
|
|
|
|
|
42 |
text_encoding = self.tokenizer(all_text, **kwargs)
|
43 |
encoding.update(text_encoding)
|
44 |
|
|
|
38 |
if type(text) == str:
|
39 |
all_text = "<image> " + text
|
40 |
else:
|
41 |
+
if type(text[0]) == str:
|
42 |
+
all_text = ["<image> " + _text for _text in text]
|
43 |
+
else:
|
44 |
+
all_text = ['<image> ' + " ".join(_text) for _text in text]
|
45 |
text_encoding = self.tokenizer(all_text, **kwargs)
|
46 |
encoding.update(text_encoding)
|
47 |
|