CogView2
CogView2 copied to clipboard
InferenceModel class do not have from_pretrained()
I build cogview2 with colab. And run your script, I have this error.
InferenceModel class do not have from_pretrained().
!./text2image.sh --input-source input.txt
WARNING: No training data specified
using world size: 1 and model-parallel size: 1
Traceback (most recent call last):
File "cogview2_text2image.py", line 233, in <module>
main(args)
File "cogview2_text2image.py", line 48, in main
model, args = InferenceModel.from_pretrained(args, 'coglm')
AttributeError: type object 'InferenceModel' has no attribute 'from_pretrained'
Are there any omissions in the committed sources?
This is strange, InferenceModel should have this method by Inheriting. Could you share your version of Python and SwissArmyTransformer(you can upgrade it to 0.2.3 and try again)?
I used old version SwissArmyTransformer==0.1.2. I update to 0.2.3 and try again.
I had error, again
Traceback (most recent call last):
File "cogview2_text2image.py", line 19, in <module>
from SwissArmyTransformer import get_args, get_tokenizer
File "/usr/local/lib/python3.7/dist-packages/SwissArmyTransformer/__init__.py", line 4, in <module>
from .model import AutoModel
File "/usr/local/lib/python3.7/dist-packages/SwissArmyTransformer/model/__init__.py", line 3, in <module>
from .encoder_decoder_model import EncoderDecoderModel
File "/usr/local/lib/python3.7/dist-packages/SwissArmyTransformer/model/encoder_decoder_model.py", line 87
return encoder_outputs, decoder_outputs, *mems
^
SyntaxError: invalid syntax
I use python 3.7, which version of Python should I use?
according to this issue #4 , maybe you should upgrade it to python 3.8.
Can you share the Colab notebook? I can periodically try it and pray that I get an A100.
@metaphorz Here is Replicate demo that is backed with A100 if you are interested :) https://replicate.com/thudm/cogview2
@chenxwh thank you I will try
@metaphorz I shared colab working. https://github.com/akira-sasaki/playground/blob/main/CogView2.ipynb
The GPU memory is 16GB at ColabPro+. So, we need --only-first-stage option.
If you want to make it all work, you might need an A100.
@akira-sasaki thanks very much.