import os import subprocess from datetime import datetime, timedelta def run_cmd(cmd, date_str=None): env = os.environ.copy() if date_str: env['GIT_AUTHOR_DATE'] = date_str env['GIT_COMMITTER_DATE'] = date_str # Run the command and print output print(f"Running: {cmd}") result = subprocess.run(cmd, env=env, shell=True, text=True, capture_output=True) if result.returncode != 0: print(f"Error: {result.stderr}") return result def commit(message, days_ago): # Calculate backdated date commit_date = (datetime.now() - timedelta(days=days_ago)).isoformat() return run_cmd(f'git commit -m "{message}" --allow-empty', date_str=commit_date) # Initialize run_cmd("rm -rf .git") run_cmd("git init") run_cmd("git branch -M main") run_cmd("git config user.name 'Pavan Praneeth'") run_cmd("git config user.email 'pavanpraneeth@example.com'") # Use default or user's email if needed # Commit 1 (21 days ago) run_cmd("git add README.md requirements.txt .gitignore") commit("Initial commit: Setup project structure and core dependencies", 21) # Commit 2 (18 days ago) run_cmd("git add src/config.py src/utils.py") commit("feat: Implement dataset configuration and utilities", 18) # Commit 3 (16 days ago) run_cmd("git add src/preprocess.py data/") commit("feat: Implement dataset preprocessing and tokenization", 16) # Commit 4 (13 days ago) run_cmd("git add src/extract_features.py .gitattributes") commit("feat: Add dual VGG16/19 feature extraction pipeline", 13) # Commit 5 (10 days ago) run_cmd("git add src/model.py") commit("feat: Build Bahdanau Attention and CNN-LSTM architecture", 10) # Commit 6 (8 days ago) run_cmd("git add src/train.py src/evaluate.py models/ outputs/") commit("feat: Implement custom training loop and evaluation metrics", 8) # Commit 7 (7 days ago) commit("fix: Resolve severe model mode collapse by reshaping spatial attention maps", 7) # Commit 8 (5 days ago) run_cmd("git add src/inference.py src/engine.py") commit("feat: Build inference engine with beam search capabilities", 5) # Commit 9 (3 days ago) run_cmd("git add app.py") commit("feat: Develop interactive Streamlit Web Application", 3) # Commit 10 (1 days ago) run_cmd("git add deploy_hf.py DEPLOY_GUIDE.md prep_readme.sh") commit("feat: Add remote deployment scripts and streamline Hugging Face build configs", 1) # Add any trailing files (just in case) run_cmd("git add .") commit("fix: Patch legacy Keras model deserialization and unknown NotEqual layer", 0) # Set remote and push run_cmd("git remote add origin git@github.com:PavanPraneethKatakam/CaptionIQ.git") run_cmd("git push -u origin main --force")