JohnnyPeng18 / HiTyper

This is the tool released in ICSE 2022 paper "Static Inference Meets Deep Learning: A Hybrid Type Inference Approach for Python"
Apache License 2.0
40 stars 6 forks source link

I cannot run the tool with type4py mode #2

Closed alaalial closed 1 year ago

alaalial commented 2 years ago

Hi, thank you for release this tool I have faced some problems first I cannot run the tool with DL mode as you can see in the image, could you please tell me what should I do to use the tool with type4py, I tried alot but I cannot 微信图片_20220327170120 second question please where is the file of groundtruth.json Ididnot find it Thank you very much

JohnnyPeng18 commented 2 years ago

You should only use -m option to indicate the json file on your computer. Such as -m predictions.json. If you want to invoke Type4Py, just use -t. And you need to modify the API in config.py to connect to Type4Py server. Do not use -m and -t at the same time.

JohnnyPeng18 commented 2 years ago

For the GT dataset, please refer to the experiment results part of README. There is a link there.

JohnnyPeng18 commented 2 years ago

And last, HiTyper only supports Linux, as stated in README.

JohnnyPeng18 commented 2 years ago

After modifying config.py, you need to rerun "pip install ." to make it effective.

JohnnyPeng18 commented 2 years ago

Thanks for the bug report. We have fixed this bug and removed the absolute path prefix. Please fetch the latest code and re-run the command.

JohnnyPeng18 commented 2 years ago

Please make sure that: 1) you re-install HiTyper using pip install . 2) You place the source file "repo/" in current directory.

JohnnyPeng18 commented 2 years ago

Please show me your command.

JohnnyPeng18 commented 2 years ago

Please go to hityper.log and look at which input file triggers this error for us to replicate this error.

JohnnyPeng18 commented 2 years ago

Sorry that we cannot replicate this error as HiTyper can successfully infer the input file. We find that this error occurs when you use the wrong Python version. As required by the README, HiTyper requires Python>=3.9 but the log states that you use Python=3.8. Please strictly follow the requirements before running.

JohnnyPeng18 commented 2 years ago

It is reasonable HiTyper fails to infer some types. Literally it is infeasible for a program using dynamically typed PL to be fully typed statically. HiTyper fails to infer the type when both static inference and type recommendation model fail.

JohnnyPeng18 commented 2 years ago

Thanks for report. We have fixed this bug, please pull the latest code.