-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain - Copy.py
More file actions
39 lines (29 loc) · 1.14 KB
/
Copy pathmain - Copy.py
File metadata and controls
39 lines (29 loc) · 1.14 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
import subprocess
import time
from chromadb_store import store_version
from rl_search.smart_reward_function import select_best_version
def run_scraper():
print("🕸️ Running scraper...")
subprocess.run(["python", "playwright_scraper.py"])
def run_ai_writer():
print("✍️ Running AI Writer...")
subprocess.run(["python", "spin_writer_ollama.py"])
def run_human_editor():
print("📝 Launching Human-in-the-Loop Editor...")
subprocess.run(["streamlit", "run", "human_loop_editor_ui.py"])
def store_final_version():
with open("output/finalversion.txt", "r", encoding="utf-8") as f:
final_content = f.read()
version_num = int(time.time()) # unique version based on timestamp
store_version(final_content, version_num)
def run_search_algorithm():
print("🔍 Retrieving best version...")
select_best_version()
if __name__ == "__main__":
run_scraper()
run_ai_writer()
print("✅ Scraper and AI Writer done.\n")
input("👉 Press Enter after Human-in-the-Loop editing is completed...")
select_best_version()
print("✅ Final version stored in ChromaDB.\n")
run_search_algorithm()