Skip to content

Fix predict.py stuck at help page - #183

Merged
HYLcool merged 2 commits into
datajuicer:mainfrom
liuyanyi:main
Jan 18, 2024
Merged

Fix predict.py stuck at help page#183
HYLcool merged 2 commits into
datajuicer:mainfrom
liuyanyi:main

Conversation

@liuyanyi

Copy link
Copy Markdown
Contributor

In quality classifier, predict.py will stuck at a help page after all procecss done. I remove the last return, it works fine.

image

@CLAassistant

CLAassistant commented Jan 18, 2024

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@HYLcool

HYLcool commented Jan 18, 2024

Copy link
Copy Markdown
Collaborator

Hi @liuyanyi . Thanks for your contribution!

For the code you modified, it's worth noticing that the return value overall in this function is used in the HPO tools as one of the optimization objectives (ref). So maybe adding an extra argument (e.g. return_overall_desc) or using existing arg overall_stats to control the return behavior might be a better choice.

    ...
    if overall_stats:
        # generate overall statistics on doc scores
        overall = pred.select('doc_score').toPandas().describe(include='all')
        # export to result report file
        overall.to_csv(os.path.join(result_path, 'overall.csv'))
        overall.to_markdown(os.path.join(result_path, 'overall.md'))
        return overall
    ...

BTW, according to the Contributor License Agreement, you need to read and accept it before your contribution is accepted.

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

If you have any further thoughts or issues, please let us know~

@liuyanyi

Copy link
Copy Markdown
Contributor Author

Hi @liuyanyi . Thanks for your contribution!

For the code you modified, it's worth noticing that the return value overall in this function is used in the HPO tools as one of the optimization objectives (ref). So maybe adding an extra argument (e.g. return_overall_desc) or using existing arg overall_stats to control the return behavior might be a better choice.

    ...
    if overall_stats:
        # generate overall statistics on doc scores
        overall = pred.select('doc_score').toPandas().describe(include='all')
        # export to result report file
        overall.to_csv(os.path.join(result_path, 'overall.csv'))
        overall.to_markdown(os.path.join(result_path, 'overall.md'))
        return overall
    ...

BTW, according to the Contributor License Agreement, you need to read and accept it before your contribution is accepted.

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

If you have any further thoughts or issues, please let us know~

You are right, there should be a return statment when overall_stats=True

@HYLcool HYLcool left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Thanks for your contribution again~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants