LordXido commited on
Commit
25008d4
·
verified ·
1 Parent(s): 44f5728

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -17
app.py CHANGED
@@ -1,31 +1,24 @@
1
- import os
2
  import zipfile
3
- import shutil
4
  from pathlib import Path
5
-
6
- # Optional: Gradio import if using UI
7
  import gradio as gr
8
 
9
  # === CONFIGURATION ===
10
  BUNDLE_ZIP = "CodexReflex_HF_SpaceBundle_20260104.zip"
11
  EXTRACT_DIR = "CodexReflexSystem"
12
- BOOT_SCRIPT = "main.py" # Replace if different
13
 
14
- # === EXTRACT SYSTEM BUNDLE ===
15
  def extract_system_bundle():
16
  if not Path(EXTRACT_DIR).exists():
17
  with zipfile.ZipFile(BUNDLE_ZIP, 'r') as zip_ref:
18
  zip_ref.extractall(EXTRACT_DIR)
19
- print(f"[+] Extracted system into: {EXTRACT_DIR}")
20
- else:
21
- print(f"[i] System already extracted.")
22
 
23
- # === RUN THE SYSTEM ===
24
- def run_system():
25
- os.chdir(EXTRACT_DIR)
26
- os.system(f"python {BOOT_SCRIPT}")
 
 
 
27
 
28
- # === ENTRY POINT ===
29
- if __name__ == "__main__":
30
- extract_system_bundle()
31
- run_system()
 
 
1
  import zipfile
 
2
  from pathlib import Path
 
 
3
  import gradio as gr
4
 
5
  # === CONFIGURATION ===
6
  BUNDLE_ZIP = "CodexReflex_HF_SpaceBundle_20260104.zip"
7
  EXTRACT_DIR = "CodexReflexSystem"
 
8
 
9
+ # === SYSTEM: Extract and Load ===
10
  def extract_system_bundle():
11
  if not Path(EXTRACT_DIR).exists():
12
  with zipfile.ZipFile(BUNDLE_ZIP, 'r') as zip_ref:
13
  zip_ref.extractall(EXTRACT_DIR)
 
 
 
14
 
15
+ extract_system_bundle()
16
+
17
+ # === Example: Minimal Gradio Interface ===
18
+ def run_logic(input_text):
19
+ return f"[Codex Reflex]: You said: {input_text}"
20
+
21
+ iface = gr.Interface(fn=run_logic, inputs="text", outputs="text", title="Codex Reflex Test")
22
 
23
+ # === Expose Interface ===
24
+ iface.launch()