Spaces:
Running
Running
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Main entry point for the Chorus Detection Streamlit app. | |
""" | |
import os | |
import sys | |
import logging | |
# Configure logging | |
logging.basicConfig( | |
level=logging.INFO, | |
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s" | |
) | |
logger = logging.getLogger("chorus-detection") | |
# Log environment info when running in HF Space | |
if os.environ.get("SPACE_ID"): | |
logger.info(f"Running in Hugging Face Space: {os.environ.get('SPACE_ID')}") | |
logger.info(f"PYTHONPATH: {os.environ.get('PYTHONPATH')}") | |
logger.info(f"MODEL_REVISION: {os.environ.get('MODEL_REVISION')}") | |
logger.info(f"Current working directory: {os.getcwd()}") | |
logger.info(f"Directory contents: {os.listdir()}") | |
def main(): | |
"""Main entry point for the Streamlit app.""" | |
logger.info("Starting Streamlit app...") | |
import streamlit_app | |
streamlit_app.main() | |
if __name__ == "__main__": | |
try: | |
main() | |
except Exception as e: | |
logger.error(f"Error running main: {e}", exc_info=True) | |
sys.exit(1) |