mesolitica / malaya

Natural Language Toolkit for Malaysian language, https://malaya.readthedocs.io/
MIT License
472 stars 127 forks source link

inspect.getargspec() is deprecated #192

Open broCapang opened 7 months ago

broCapang commented 7 months ago

Screenshot 2024-04-20 032907

An error occurred while playing with the examples. in malaya\supervised\huggingface.py

---> 22 args = inspect.getargspec(class_model)

Apparently inspect.getargspec has been deprecated. ref: https://github.com/pytorch/pytorch/issues/15344

Changes

replace inspect.getargspec with inspect.getfullargspec

huseinzol05 commented 7 months ago

apa version python

broCapang commented 7 months ago

apa version python

Python 3.11.4

broCapang commented 7 months ago

Mintak follow up

huseinzol05 commented 6 months ago

u need to test on version python3.11 and below python3.11

MagusWyvern commented 3 months ago

This error only occurs on Python 3.11 and newer as inspect.getargspec() was removed in that version. While the modern solution is to use inspect.signature() I have doubts of it working on versions <3.11.

This implementation seems like a good workaround to the deprecation warnings while also being stable, nanti saya akan test pakai Python <3.11 ok atau tidak