-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (22 loc) · 883 Bytes
/
main.py
File metadata and controls
27 lines (22 loc) · 883 Bytes
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
# main.py
import subprocess
import sys
from ui import app # Imports the demo object from ui/app.py
def main():
print("--- Starting RAG-TAG Production System ---")
# 1. Start the Huey Curator as a background process
print("--- Launching background Curator process... ---")
consumer_command = [sys.executable, '-m', 'huey.bin.huey_consumer', 'curator.tasks.huey']
consumer_process = subprocess.Popen(consumer_command)
print("--- Curator is online. ---")
# 2. Launch the Gradio Web UI
print("--- Launching Gradio Console... ---")
# This will block and run the web server
app.demo.launch()
# 3. Clean up the background process when the UI is closed
print("--- Shutting down Curator process... ---")
consumer_process.terminate()
consumer_process.wait()
print("--- System offline. ---")
if __name__ == "__main__":
main()