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

Run Translation - Refactor command-line script into a Python module #8

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

JooZef315
Copy link
Contributor

Purpose

This PR converts an existing command-line script run_translation.py into a Python module for better structure, reuse, and test coverage.

Summary of Changes

  1. Refactored the original script into a Python module (run_translation_module.py).
  2. Created a test suite using unittest to validate the functionality of the module.

Testing Instructions

  1. Run unittest to execute the tests: python -m unittest tests/translation_module_test.py

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 25, 2024

# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's be consistent about the license header here (it's important because those headers are automatically parsed by our bot and it will raise warning / error if the format is not recognized)

tests/translation_demo.py Outdated Show resolved Hide resolved
from omegaconf import OmegaConf

# Add the parent directory to sys.path so it can locate the `translation` folder
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest removing this, and just specifying a fully qualified path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants