Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,33 +1,36 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
return f"""
|
| 8 |
-
<div
|
| 9 |
-
<h2
|
| 10 |
-
<p>
|
| 11 |
-
<
|
| 12 |
-
|
| 13 |
-
<p>Waiting for architecture commands...</p>
|
| 14 |
</div>
|
| 15 |
-
<script>
|
| 16 |
-
// This is where your autonomous logic will execute.
|
| 17 |
-
console.log("Foundry Engine Initialized.");
|
| 18 |
-
</script>
|
| 19 |
</div>
|
| 20 |
"""
|
| 21 |
|
| 22 |
-
with gr.Blocks(theme=gr.themes.
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
with gr.Row():
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
preview = gr.HTML(label="Live Neural Preview")
|
| 30 |
-
|
| 31 |
-
init_btn.click(fn=update_foundry, inputs=cmd_input, outputs=preview)
|
| 32 |
|
| 33 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
# The 'Soul' of your app - custom CSS that defines the 'DeepSite' feel
|
| 4 |
+
custom_css = """
|
| 5 |
+
#foundry-canvas {
|
| 6 |
+
height: 90vh !important;
|
| 7 |
+
border: none !important;
|
| 8 |
+
background: #050505 !important;
|
| 9 |
+
}
|
| 10 |
+
.gradio-container { max-width: 100% !important; }
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
# The 'Brain' - your core logic
|
| 14 |
+
def run_command(prompt):
|
| 15 |
+
# This block generates the actual frontend code that gets injected
|
| 16 |
return f"""
|
| 17 |
+
<div style="padding:20px; color:white;">
|
| 18 |
+
<h2>Engine Active</h2>
|
| 19 |
+
<p>Executing: {prompt}</p>
|
| 20 |
+
<div id="module-container" style="border: 1px solid #333; padding: 20px;">
|
| 21 |
+
<button onclick="alert('Module Logic Triggered!')" style="background: cyan; padding:10px;">TEST MODULE</button>
|
|
|
|
| 22 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
</div>
|
| 24 |
"""
|
| 25 |
|
| 26 |
+
with gr.Blocks(css=custom_css, theme=gr.themes.Base()) as demo:
|
| 27 |
+
# A cleaner, full-screen approach
|
| 28 |
+
canvas = gr.HTML(elem_id="foundry-canvas")
|
| 29 |
+
|
| 30 |
with gr.Row():
|
| 31 |
+
cmd_input = gr.Textbox(placeholder="Describe your next module...", show_label=False)
|
| 32 |
+
btn = gr.Button("INITIALIZE")
|
| 33 |
+
|
| 34 |
+
btn.click(fn=run_command, inputs=cmd_input, outputs=canvas)
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
demo.launch()
|