import os import sys # Simulate HF Space environment where everything is in root # but locally we are in hf_space subdirectory BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, BASE_DIR) print(f"Current working directory: {os.getcwd()}") print(f"Script directory: {BASE_DIR}") try: from data import manager print(f"Imported manager from {manager.__file__}") print(f"manager.DATA_DIR: {manager.DATA_DIR}") print(f"manager.AUDIO_DIR: {manager.AUDIO_DIR}") # Create data dir if not exists os.makedirs(manager.DATA_DIR, exist_ok=True) # Mock writing file test_file = os.path.join(manager.DATA_DIR, "debug_test.txt") with open(test_file, "w") as f: f.write("test") print(f"Wrote test file to {test_file}") print(f"Exists? {os.path.exists(test_file)}") except ImportError as e: print(f"ImportError: {e}") except Exception as e: print(f"Error: {e}")