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

Silent PYTEXT_HOME print/exception during importing #1036

Closed
wants to merge 1 commit into from

Conversation

hudeven
Copy link
Contributor

@hudeven hudeven commented Oct 7, 2019

Differential Revision: D17796032

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

This pull request was exported from Phabricator. Differential Revision: D17796032

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D17796032

hudeven added a commit to hudeven/pytext that referenced this pull request Oct 9, 2019
…#1036)

Summary:
Pull Request resolved: facebookresearch#1036

1. PYTEXT_HOME will add unrelated print in some cases, e.g. PyText -> Fluent2 -> other non-PyText project using Fluent2)
2. Corner case: PyText is imported as a module and packed into a single binary file,  `__file__` will be the path of the binary file instead of path.py and cause exception
3. In this case, we set PYTEXT_HOME to be the folder of that binary file and assuming the data files will be put either in the same folder or providing a absolute path in config file

Differential Revision: D17796032

fbshipit-source-id: eae3ed9090ac840208f91c5411b52c0832c0577f
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D17796032

hudeven added a commit to hudeven/pytext that referenced this pull request Oct 9, 2019
…#1036)

Summary:
Pull Request resolved: facebookresearch#1036

1. PYTEXT_HOME will add unrelated print in some cases, e.g. PyText -> Fluent2 -> other non-PyText project using Fluent2)
2. Corner case: PyText is imported as a module and packed into a single binary file,  `__file__` will be the path of the binary file instead of path.py and cause exception
3. In this case, we set PYTEXT_HOME to be the folder of that binary file and assuming the data files will be put either in the same folder or providing a absolute path in config file

Differential Revision: D17796032

fbshipit-source-id: 5fbb28fc3de378ff6d26d20ba69cc346c77180e3
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D17796032

@hudeven hudeven changed the title use models folder as anchor for PYTEXT_HOME Silent PYTEXT_HOME print/exception during importing Oct 9, 2019
…#1036)

Summary:
Pull Request resolved: facebookresearch#1036

1. PYTEXT_HOME will add unrelated print in some cases, e.g. PyText -> Fluent2 -> other non-PyText project using Fluent2)
2. Corner case: PyText is imported as a module and packed into a single binary file,  `__file__` will be the path of the binary file instead of path.py and cause exception
3. In this case, we set PYTEXT_HOME to be the folder of that binary file and assuming the data files will be put either in the same folder or providing a absolute path in config file

Reviewed By: chenyangyu1988

Differential Revision: D17796032

fbshipit-source-id: 4258b71bc7dcbc80977ebada4aefb1c4222550b7
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D17796032

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in ba21aff.

@hudeven hudeven deleted the export-D17796032 branch October 12, 2019 04:35
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