-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Text2Image into Taskflow #2988
Add Text2Image into Taskflow #2988
Conversation
docs/model_zoo/taskflow.md
Outdated
* `top_p`:解码参数top_p,默认为1.0。 | ||
* `conditional_scale`:dalle-mini模型使用的参数,可参考[推特](https://twitter.com/RiversHaveWings/status/1478093658716966912),默认为10.0。 | ||
* `num_return_images`:返回图片的数量,默认为4,即4张图片水平拼接形成一张长图。 | ||
* `use_faster`:是否使用faster_generation,默认为False,目前artist模型支持,而dalle-mini模型不支持。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里也尽量隐去 artist 吧,这个模型名确实不见得有认可度,先用 pai这些模型权重来体现吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use_faster
:是否使用faster_generation,默认为False,目前支持faster_generation的模型有["pai-painter-painting-base-zh", "pai-painter-scenery-base-zh", "pai-painter-commercial-base-zh"]
。
if self._model.base_model_prefix == "dallebart": | ||
images = (images.clip(0, 1) * 255).astype("uint8") | ||
elif self._model.base_model_prefix == "gpt": | ||
images = ((images + 1.0) * 127.5).clip(0, 255).astype("uint8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些后处理如果是和模型绑定的话后面也可以看看将这些方法放在transformers模型代码中提供出来,这里进行统一调用,方便更多模型扩展
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, 现已添加到model的generate内部。
PR types
New features
PR changes
Others
Description
Add Text2Image into Taskflow