Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix predict.py stuck at help page #183

Merged
merged 2 commits into from
Jan 18, 2024
Merged

Fix predict.py stuck at help page #183

merged 2 commits into from
Jan 18, 2024

Conversation

liuyanyi
Copy link
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
Copy link

CLAassistant commented Jan 18, 2024

CLA assistant check
All committers have signed the CLA.

@HYLcool
Copy link
Collaborator

HYLcool commented Jan 18, 2024

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
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

Copy link
Collaborator

@HYLcool HYLcool left a comment

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~

@HYLcool HYLcool merged commit 8600d83 into modelscope:main Jan 18, 2024
3 checks passed
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