update readme

This commit is contained in:
Brett Kuprel 2022-07-05 07:44:42 -04:00
parent 8c204296d7
commit ba6080668f
2 changed files with 2 additions and 1 deletions

2
README.md vendored
View File

@ -49,7 +49,7 @@ display(image)
``` ```
<img src="https://github.com/kuprel/min-dalle/raw/main/examples/dali_walle.jpg" alt="min-dalle" width="300"/> <img src="https://github.com/kuprel/min-dalle/raw/main/examples/dali_walle.jpg" alt="min-dalle" width="300"/>
If the model is being used interactively (e.g. in a notebook) `generate_image_stream` can be used to generate a stream of images as it the model is decoding. The detokenizer adds a slight delay for each intermediate image. Setting `log2_mid_count` to 3 results in a total of `2 ** 3 = 8` generated images. The only valid values for `log2_mid_count` are 0, 1, 2, 3, 4. If the model is being used interactively (e.g. in a notebook) `generate_image_stream` can be used to generate a stream of images as the model is decoding. The detokenizer adds a slight delay for each image. Setting `log2_mid_count` to 3 results in a total of `2 ** 3 = 8` generated images. The only valid values for `log2_mid_count` are 0, 1, 2, 3, 4.
```python ```python
image_stream = model.generate_image_stream( image_stream = model.generate_image_stream(

View File

@ -168,6 +168,7 @@ class MinDalle:
log2_supercondition_factor: int = 3, log2_supercondition_factor: int = 3,
is_verbose: bool = False is_verbose: bool = False
) -> Iterator[Image.Image]: ) -> Iterator[Image.Image]:
assert(log2_mid_count in range(5))
if is_verbose: print("tokenizing text") if is_verbose: print("tokenizing text")
tokens = self.tokenizer.tokenize(text, is_verbose=is_verbose) tokens = self.tokenizer.tokenize(text, is_verbose=is_verbose)
if is_verbose: print("text tokens", tokens) if is_verbose: print("text tokens", tokens)