Spaces:
Sleeping
Sleeping
Download app.py from jien0404/Translator: direct link, hf CLI and curl.
- Browser
- Download file 701 Bytes
-
https://huggingface.co/spaces/jien0404/Translator/resolve/main/app.py
- Command line
-
hf download hf://spaces/jien0404/Translator/app.py
-
curl -L -o app.py https://huggingface.co/spaces/jien0404/Translator/resolve/main/app.py
701 Bytes
| from translation_service import TranslationService | |
| from ui_interface import create_interface | |
| from config import DEFAULT_MODEL_CHOICE | |
| def main(): | |
| """Main function to run the translation app""" | |
| print("Initializing Translation Service...") | |
| # Initialize the translation service | |
| translation_service = TranslationService() | |
| print("Pre-loading popular model...") | |
| translation_service.warm_up_default_model(DEFAULT_MODEL_CHOICE) | |
| print("Creating user interface...") | |
| # Create the Gradio interface | |
| demo = create_interface(translation_service) | |
| print("Starting Gradio app...") | |
| # Launch the app | |
| demo.launch() | |
| if __name__ == "__main__": | |
| main() |