Spaces:
Sleeping
Sleeping
| import os | |
| from dotenv import load_dotenv | |
| # Load environment variables from .env.local | |
| load_dotenv(os.path.join(os.path.dirname(os.path.dirname(__file__)), ".env.local")) | |
| # Model Configurations | |
| SCRIPT_GENERATION_MODEL = "unsloth/Phi-4-mini-instruct-unsloth-bnb-4bit" | |
| # User API Keys (Bring Your Own Key - BYOK) | |
| # Users provide these through the settings interface or environment variables | |
| OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", "") | |
| INFERENCE_API_URL = os.getenv("INFERENCE_API_URL", "") | |
| INFERENCE_API_KEY = os.getenv("INFERENCE_API_KEY", "") | |
| # TTS API Settings (ElevenLabs) | |
| ELEVENLABS_API_KEY = os.getenv("ELEVENLABS_API_KEY", "") | |
| # ElevenLabs Voice IDs (you can change these to different voices) | |
| # Find more voices at: https://api.elevenlabs.io/v1/voices | |
| ELEVENLABS_HOST_VOICE = "ErXwobaYiN019PkySvjV" # Antoni - male voice for Host | |
| ELEVENLABS_GUEST_VOICE = "EXAVITQu4vr4xnSDxMaL" # Bella - female voice for Guest | |
| # Paths | |
| BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| TEMP_DIR = os.path.join(BASE_DIR, "temp") | |
| OUTPUT_DIR = os.path.join(BASE_DIR, "output") | |
| # Ensure directories exist | |
| os.makedirs(TEMP_DIR, exist_ok=True) | |
| os.makedirs(OUTPUT_DIR, exist_ok=True) | |
| # Generation Settings | |
| MAX_TOKENS = 4096 # Supports long-form content generation | |
| TEMPERATURE = 0.7 | |
| # Context Limits for Multi-Paper Processing | |
| MAX_CONTEXT_CHARS = 80000 # Maximum total characters for multiple papers (~60K tokens) | |
| # This ensures we stay well within the 128K token limit while leaving room for prompts and responses | |