Spaces:
Running
Running
Update main.py
Browse filestemporarily deployed PureChain
main.py
CHANGED
|
@@ -1,59 +1,59 @@
|
|
| 1 |
-
import
|
| 2 |
-
import warnings
|
| 3 |
-
|
| 4 |
-
# Filter warnings immediately
|
| 5 |
-
warnings.filterwarnings("ignore", category=SyntaxWarning, module="pydub")
|
| 6 |
-
|
| 7 |
-
# --- INTERNAL IMPORTS ---
|
| 8 |
-
from config import AppConfig
|
| 9 |
-
from src.utils import create_warning_beep
|
| 10 |
-
|
| 11 |
-
# Import your refactored classes
|
| 12 |
-
from src.managers import GeminiManager, HFManager
|
| 13 |
-
from src.input_agent import AgentInput
|
| 14 |
-
from src.brain_agent import AgentInterpretation
|
| 15 |
-
from src.trust_agent import AgentTrust
|
| 16 |
-
from src.ux_agent import AgentUX
|
| 17 |
-
|
| 18 |
-
def main():
|
| 19 |
-
print("🚀 Initializing Modular Architecture IEDI (MA-IEDI)...")
|
| 20 |
-
|
| 21 |
-
# 1. Setup Configuration & Directories
|
| 22 |
-
AppConfig.setup_directories()
|
| 23 |
-
|
| 24 |
-
# 2. Initialize Managers (Inject Config)
|
| 25 |
-
# We pass AppConfig to HFManager so it knows where to download files
|
| 26 |
-
hf_manager = HFManager(AppConfig)
|
| 27 |
-
hf_manager.pull_datasets()
|
| 28 |
-
|
| 29 |
-
# Initialize Gemini (Brain Stem)
|
| 30 |
-
gemini_manager = GeminiManager(AppConfig.GOOGLE_API_KEY) if AppConfig.GOOGLE_API_KEY else None
|
| 31 |
-
|
| 32 |
-
# 3. Initialize Agents (Dependency Injection)
|
| 33 |
-
|
| 34 |
-
# Agent 1: Input (Whisper)
|
| 35 |
-
agent1 = AgentInput()
|
| 36 |
-
|
| 37 |
-
# Agent 2: Brain (Interpretation)
|
| 38 |
-
# We pass AppConfig so it knows where PROFILES_DIR is
|
| 39 |
-
agent2 = AgentInterpretation(AppConfig, gemini_manager_instance=gemini_manager)
|
| 40 |
-
|
| 41 |
-
# Agent 4: Trust (Blockchain/IPFS)
|
| 42 |
-
# We pass AppConfig so it has keys for Web3 and Pinata
|
| 43 |
-
agent4 = AgentTrust(AppConfig)
|
| 44 |
-
# Inject hf_manager into Trust so it can save audio files to HF
|
| 45 |
-
agent4.hf_manager_ref = hf_manager
|
| 46 |
-
|
| 47 |
-
# Agent 3: UX (Interface)
|
| 48 |
-
agent3 = AgentUX(agent1, agent2, agent4)
|
| 49 |
-
|
| 50 |
-
# 4. Launch
|
| 51 |
-
print("✅ System Assembled. Launching Interface...")
|
| 52 |
-
|
| 53 |
-
# Pass the warning beep path
|
| 54 |
-
agent3.WARNING_BEEP_PATH = create_warning_beep()
|
| 55 |
-
|
| 56 |
-
agent3.launch()
|
| 57 |
-
|
| 58 |
-
if __name__ == "__main__":
|
| 59 |
main()
|
|
|
|
| 1 |
+
import deploy_purechain # <--- ADD THIS LINE ONLY TEMPORARILY
|
| 2 |
+
import warnings
|
| 3 |
+
|
| 4 |
+
# Filter warnings immediately
|
| 5 |
+
warnings.filterwarnings("ignore", category=SyntaxWarning, module="pydub")
|
| 6 |
+
|
| 7 |
+
# --- INTERNAL IMPORTS ---
|
| 8 |
+
from config import AppConfig
|
| 9 |
+
from src.utils import create_warning_beep
|
| 10 |
+
|
| 11 |
+
# Import your refactored classes
|
| 12 |
+
from src.managers import GeminiManager, HFManager
|
| 13 |
+
from src.input_agent import AgentInput
|
| 14 |
+
from src.brain_agent import AgentInterpretation
|
| 15 |
+
from src.trust_agent import AgentTrust
|
| 16 |
+
from src.ux_agent import AgentUX
|
| 17 |
+
|
| 18 |
+
def main():
|
| 19 |
+
print("🚀 Initializing Modular Architecture IEDI (MA-IEDI)...")
|
| 20 |
+
|
| 21 |
+
# 1. Setup Configuration & Directories
|
| 22 |
+
AppConfig.setup_directories()
|
| 23 |
+
|
| 24 |
+
# 2. Initialize Managers (Inject Config)
|
| 25 |
+
# We pass AppConfig to HFManager so it knows where to download files
|
| 26 |
+
hf_manager = HFManager(AppConfig)
|
| 27 |
+
hf_manager.pull_datasets()
|
| 28 |
+
|
| 29 |
+
# Initialize Gemini (Brain Stem)
|
| 30 |
+
gemini_manager = GeminiManager(AppConfig.GOOGLE_API_KEY) if AppConfig.GOOGLE_API_KEY else None
|
| 31 |
+
|
| 32 |
+
# 3. Initialize Agents (Dependency Injection)
|
| 33 |
+
|
| 34 |
+
# Agent 1: Input (Whisper)
|
| 35 |
+
agent1 = AgentInput()
|
| 36 |
+
|
| 37 |
+
# Agent 2: Brain (Interpretation)
|
| 38 |
+
# We pass AppConfig so it knows where PROFILES_DIR is
|
| 39 |
+
agent2 = AgentInterpretation(AppConfig, gemini_manager_instance=gemini_manager)
|
| 40 |
+
|
| 41 |
+
# Agent 4: Trust (Blockchain/IPFS)
|
| 42 |
+
# We pass AppConfig so it has keys for Web3 and Pinata
|
| 43 |
+
agent4 = AgentTrust(AppConfig)
|
| 44 |
+
# Inject hf_manager into Trust so it can save audio files to HF
|
| 45 |
+
agent4.hf_manager_ref = hf_manager
|
| 46 |
+
|
| 47 |
+
# Agent 3: UX (Interface)
|
| 48 |
+
agent3 = AgentUX(agent1, agent2, agent4)
|
| 49 |
+
|
| 50 |
+
# 4. Launch
|
| 51 |
+
print("✅ System Assembled. Launching Interface...")
|
| 52 |
+
|
| 53 |
+
# Pass the warning beep path
|
| 54 |
+
agent3.WARNING_BEEP_PATH = create_warning_beep()
|
| 55 |
+
|
| 56 |
+
agent3.launch()
|
| 57 |
+
|
| 58 |
+
if __name__ == "__main__":
|
| 59 |
main()
|