Open jainnipun11 opened 2 years ago
Hi @jainnipun11,
I think I have found the cause of the issue. The return typing hints on this line are incompatible with python 3.7
(but work fine with python 3.9
): https://github.com/aehrc/cvt2distilgpt2/blob/13d450ac3509e0d671f2aed701d57d01e2d73618/transmodal/network/cvt.py#L77
e.g., if we have tmp.py
:
from typing import Optional, Union, Any
def forward(images) -> Union[dict[str, float], dict[str, Union[float, Any]]]:
return None
The following error occurs with python 3.7
, but not with python 3.9
compute-i1 ~$ module load python/3.7.11
Loading python/3.7.11
Unloading conflict: python/3.9.4
compute-i1 ~$ python3 tmp.py
Traceback (most recent call last):
File "tmp.py", line 4, in <module>
def forward(images) -> Union[dict[str, float], dict[str, Union[float, Any]]]:
TypeError: 'type' object is not subscriptable
compute-i1 ~$ module load python/3.9.4
Loading python/3.9.4
Unloading conflict: python/3.7.11
compute-i1 ~$ python3 tmp.py
compute-i1 ~$
So, I have removed the return typing hints for that function: https://github.com/aehrc/cvt2distilgpt2/blob/77656703a67b03c4ea415fbaab4766c1218c479e/transmodal/network/cvt.py#L77
If you can check if this worked, that would be great and please let me know of any further issues after this.
Thanks, Aaron.
Hey Aaron, I modified according to you and now I got this error:
/content/drive/MyDrive/cvt2distilgpt2/transmodal/utils.py:39: UserWarning: Workstation configuration for 5f6e9f0cc0f3 does not exist. Using default configuration: num_workers=5, total_gpus=1, total_memory=16 warnings.warn(f"Workstation configuration for {socket.gethostname()} does not exist. Using default "
TypeError: expected str, bytes or os.PathLike object, not NoneType
Thanks.
Hi @jainnipun11,
Can you confirm that you have downloaded the files for distilgpt2
from https://huggingface.co/distilgpt2/tree/main and have placed them in https://github.com/aehrc/cvt2distilgpt2/tree/main/checkpoints/distilgpt2?
I have made some updates to check for path issues. Can you please pull the latest version and test?
And if problems persist, can you please try python 3.8 or 3.9??
Hope this helps, Aaron.
Hey Aaron,
I followed all your path instructions and I have stored the 4 files inside the recommended folder. Now, I updated the python version to python 3.9.1, and this is the result:
/content/drive/MyDrive/cvt2distilgpt2/transmodal/utils.py:39: UserWarning: Workstation configuration for ad62cbeafeaa does not exist. Using default configuration: num_workers=5, total_gpus=1, total_memory=16 warnings.warn(f"Workstation configuration for {socket.gethostname()} does not exist. Using default "
TypeError: expected str, bytes or os.PathLike object, not NoneType
Hi @jainnipun11,
It seems that you did not pull the latest version of the repo.
In your error, AutoTokenizer
is on line 87
File "/content/drive/MyDrive/cvt2distilgpt2/transmodal/config.py", line 87, in get_config
config["tokenizer"] = AutoTokenizer.from_pretrained(
Whereas, in the latest repo, it is on line 93: https://github.com/aehrc/cvt2distilgpt2/blob/618bdba5de308d9cb2059c75158464b7ec5b408f/transmodal/config.py#L93
Please pull the latest repo and we can go from there.
Aaron.
Hey Aaron. This time around I am encountering a different error altogether. I am using Python 3.9. Installed all the requirements using this.
Traceback (most recent call last):
File "/content/drive/MyDrive/cvt2distilgpt2/main.py", line 9, in
ValueError: transformers.models.auto.spec is None
Hi @jainnipun11,
Try this: https://github.com/huggingface/transformers/issues/15212
Hey Aaron! I referred the repository you suggested, it resolved the issue I was encountering earlier, but again the return type error occured.
/content/drive/MyDrive/cvt2distilgpt2/transmodal/utils.py:39: UserWarning: Workstation configuration for b563c33267e1 does not exist. Using default configuration: num_workers=5, total_gpus=1, total_memory=16 warnings.warn(f"Workstation configuration for {socket.gethostname()} does not exist. Using default "
Thank you. Nipun
Hi Nipun,
I will look into this tomorrow, but in the meantime could you please try this GPT2 example in the same environment and let me know if it works? https://huggingface.co/docs/transformers/model_doc/gpt2#transformers.GPT2LMHeadModel.forward.example
Thanks for your patience, Aaron.
After I ran "!python3 main.py --task mimic_cxr_jpg_chen". I got the following error:
warnings.warn(f"Workstation configuration for {socket.gethostname()} does not exist. Using default "
TypeError: 'type' object is not subscriptable
Please guide me through this. Thank you.