-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
25 lines (20 loc) · 705 Bytes
/
Copy pathapp.py
File metadata and controls
25 lines (20 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from dotenv import load_dotenv
from src.translator_app.config import Config
from src.translator_app.translator import TranslatorApp
from src.translator_app.gradio_interface import GradioInterface
def main():
try:
# Load environment variables
load_dotenv()
# Initialize Config (which initializes Logger)
config = Config()
# Initialize Translator Application
translator = TranslatorApp(config)
# Launch Gradio Interface
gradio_app = GradioInterface(translator)
gradio_app.launch()
except Exception as e:
# Use the logger from Config
config.logger.error(f"Error: {e}")
if __name__ == "__main__":
main()