Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def optimize_allocation(donations, ngos, volunteers):
|
| 4 |
+
return f"Optimized allocation for:\nDonations: {donations}\nNGOs: {ngos}\nVolunteers: {volunteers}"
|
| 5 |
+
|
| 6 |
+
with gr.Blocks() as demo:
|
| 7 |
+
gr.Markdown("# 🍱 Donum OpenEnv")
|
| 8 |
+
gr.Markdown("AI system for optimizing food donation distribution")
|
| 9 |
+
|
| 10 |
+
donations = gr.Textbox(label="Donations")
|
| 11 |
+
ngos = gr.Textbox(label="NGOs")
|
| 12 |
+
volunteers = gr.Textbox(label="Volunteers")
|
| 13 |
+
|
| 14 |
+
output = gr.Textbox(label="Optimized Result")
|
| 15 |
+
|
| 16 |
+
btn = gr.Button("Run Optimization")
|
| 17 |
+
btn.click(optimize_allocation, inputs=[donations, ngos, volunteers], outputs=output)
|
| 18 |
+
|
| 19 |
+
demo.launch()
|