Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Fix OSS predict-py API #1320

Closed
wants to merge 7 commits into from
Closed

Conversation

hudeven
Copy link
Contributor

@hudeven hudeven commented Apr 16, 2020

Motivation and Context

OSS predict-py API(load PyTorch model and predict for a row of json) is broken. It requires pass a valid label in json, which doesn't make sense during inference. With this diff, only columns/tensorizers with is_input=True are required during inference

How Has This Been Tested

Added unit test:
$ pytest tests/main_test.py

Test in command line
$ pytext predict-py --model-file /tmp/model.pt <<< '{"text": "create an alarm for 1:30 pm"}'

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 16, 2020
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@hudeven has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@hudeven merged this pull request in cb8e2c5.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants