Spaces:
Sleeping
Sleeping
Upload 8 files
Browse files- README 7.md +2 -0
- app 10.py +31 -0
- emotional_core.py +6 -0
- ethics_audit.py +12 -0
- petgrid 2.py +6 -0
- petgrid.py +6 -0
- requirements 3.txt +7 -0
- sarcore.py +6 -0
README 7.md
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
# Codette Flood Response System
|
2 |
+
A voice-enabled emergency response tool built with Gradio. Modules include SAR, EmotionalCore, PetGrid, and EthicsAudit. Deploy to Hugging Face Spaces using app.py.
|
app 10.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import gradio as gr
|
3 |
+
import sarcore, emotional_core, petgrid, ethics_audit
|
4 |
+
|
5 |
+
ONLINE_MODE = bool(int(os.getenv("ONLINE_MODE", "0")))
|
6 |
+
|
7 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
8 |
+
gr.Markdown("# 🌊 Codette Flood Response System")
|
9 |
+
mode_toggle = gr.Radio(["Offline Mode", "Online Mode"], value=("Online Mode" if ONLINE_MODE else "Offline Mode"), label="Mode")
|
10 |
+
mode_status = gr.Textbox(value="Online" if ONLINE_MODE else "Offline", interactive=False)
|
11 |
+
|
12 |
+
def switch_mode(choice):
|
13 |
+
global ONLINE_MODE
|
14 |
+
ONLINE_MODE = (choice == "Online Mode")
|
15 |
+
return choice
|
16 |
+
|
17 |
+
mode_toggle.change(switch_mode, inputs=mode_toggle, outputs=mode_status)
|
18 |
+
|
19 |
+
with gr.Tab("Search & Rescue"):
|
20 |
+
sarcore.render(ONLINE_MODE)
|
21 |
+
|
22 |
+
with gr.Tab("Emotional Support"):
|
23 |
+
emotional_core.render(ONLINE_MODE)
|
24 |
+
|
25 |
+
with gr.Tab("Pet Reunification"):
|
26 |
+
petgrid.render(ONLINE_MODE)
|
27 |
+
|
28 |
+
with gr.Tab("Audit Log"):
|
29 |
+
ethics_audit.render()
|
30 |
+
|
31 |
+
demo.launch()
|
emotional_core.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def render(online):
|
4 |
+
with gr.Column():
|
5 |
+
gr.Markdown("### EmotionalCore Chat")
|
6 |
+
gr.Textbox(label="(Placeholder) Chatbot ready in {} mode.".format("Online" if online else "Offline"))
|
ethics_audit.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
log = []
|
4 |
+
|
5 |
+
def log_event(msg):
|
6 |
+
log.append(msg)
|
7 |
+
|
8 |
+
def render():
|
9 |
+
with gr.Column():
|
10 |
+
gr.Markdown("### Ethics Audit Log")
|
11 |
+
logbox = gr.Textbox(value="\n".join(log or ["No activity yet."]), lines=10, interactive=False)
|
12 |
+
gr.Button("Refresh").click(lambda: "\n".join(log or ["No activity yet."]), outputs=logbox)
|
petgrid 2.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def render(online):
|
4 |
+
with gr.Column():
|
5 |
+
gr.Markdown("### PetGrid - Lost/Found Pet Support")
|
6 |
+
gr.Textbox(label="(Placeholder) PetGrid operating in {} mode.".format("Online" if online else "Offline"))
|
petgrid.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def render(online):
|
4 |
+
with gr.Column():
|
5 |
+
gr.Markdown("### PetGrid - Lost/Found Pet Support")
|
6 |
+
gr.Textbox(label="(Placeholder) PetGrid operating in {} mode.".format("Online" if online else "Offline"))
|
requirements 3.txt
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
gradio==4.29.0
|
2 |
+
numpy
|
3 |
+
openai-whisper
|
4 |
+
TTS
|
5 |
+
torchaudio
|
6 |
+
transformers
|
7 |
+
pandas
|
sarcore.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def render(online):
|
4 |
+
with gr.Column():
|
5 |
+
gr.Markdown("### Rescue Operations")
|
6 |
+
gr.Textbox(label="(Placeholder) SAR is active in {} mode.".format("Online" if online else "Offline"))
|