#!/usr/bin/env python3 """ First-time setup script for Meeting Assistant Downloads required AI models and sets up environment """ import os import sys import subprocess import platform def install_dependencies(): """Install Python dependencies""" print("šŸ“¦ Installing Python dependencies...") subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"]) def download_models(): """Download AI models""" print("šŸ¤– Downloading AI models...") # Create models directory os.makedirs("models", exist_ok=True) # Download TinyLlama (small, fast, works on CPU) model_urls = { "tinyllama-1.1b.Q4_K_M.gguf": "https://huggingface.co/TheBloke/TinyLlama-1.1B-GGUF/resolve/main/tinyllama-1.1b.Q4_K_M.gguf" } import urllib.request for model_name, url in model_urls.items(): model_path = os.path.join("models", model_name) if not os.path.exists(model_path): print(f"Downloading {model_name}...") try: urllib.request.urlretrieve(url, model_path) print(f"āœ… Downloaded {model_name}") except Exception as e: print(f"āŒ Failed to download {model_name}: {e}") print("āš ļø Will run in fallback mode without local LLM") else: print(f"āœ… {model_name} already exists") def setup_audio(): """Test audio setup""" print("šŸŽ¤ Testing audio input...") try: import sounddevice as sd devices = sd.query_devices() input_devices = [d for d in devices if d['max_input_channels'] > 0] if input_devices: print(f"āœ… Found {len(input_devices)} audio input devices") for device in input_devices: print(f" - {device['name']}") else: print("āš ļø No audio input devices found") except Exception as e: print(f"āš ļø Audio setup error: {e}") def main(): """Run setup""" print("šŸ”§ Meeting Assistant - Setup") print("=" * 50) # Check Python version if sys.version_info < (3, 8): print("āŒ Python 3.8 or higher required") sys.exit(1) # Platform info print(f"šŸ’» Platform: {platform.system()}") # Install dependencies install_dependencies() # Download models download_models() # Setup audio setup_audio() print("\nāœ… Setup complete!") print("Run 'python main.py' to start the assistant") if __name__ == "__main__": main()