-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
55 lines (46 loc) · 1.57 KB
/
Copy pathrun.py
File metadata and controls
55 lines (46 loc) · 1.57 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python3
"""
Simple launcher script for AI Meme Poster Creator
Run this file to start the application
"""
import subprocess
import sys
import os
def check_requirements():
"""Check if required packages are installed"""
try:
import streamlit
import google.generativeai
from PIL import Image
print("✅ All required packages are installed")
return True
except ImportError as e:
print(f"❌ Missing package: {e}")
print("Installing requirements...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
return True
def main():
print("🎭 AI Meme Poster Creator")
print("=" * 30)
# Check if we're in the right directory
if not os.path.exists("app.py"):
print("❌ app.py not found. Make sure you're in the project directory.")
return
# Check requirements
if not check_requirements():
return
# Check API key configuration
try:
import config
if config.GEMINI_API_KEY == "YOUR_GEMINI_API_KEY_HERE":
print("⚠️ Don't forget to add your Gemini API key in config.py!")
except ImportError:
print("⚠️ config.py not found. Please check your installation.")
print("🚀 Starting the application...")
print("📱 The app will open in your browser shortly...")
print("🔄 To stop the app, press Ctrl+C in this terminal")
print()
# Launch the app
subprocess.run([sys.executable, "-m", "streamlit", "run", "app.py"])
if __name__ == "__main__":
main()