tjido commited on
Commit
2ca7a8c
·
verified ·
1 Parent(s): b86cd1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +106 -8
app.py CHANGED
@@ -6,31 +6,81 @@ funding_programs = [
6
  "name": "Education Partnerships Program",
7
  "description": "Promotes collaboration between First Nations, provinces, ISC and other stakeholders to advance First Nations education.",
8
  "deadline": "Annual - February 28",
9
- "focus": "K-12 education systems collaboration"
 
 
10
  },
11
  {
12
  "name": "Post-Secondary Partnerships Program",
13
  "description": "Supports projects that develop and deliver college/university programs for Indigenous students.",
14
  "deadline": "Annual - December 15",
15
- "focus": "Post-secondary education development"
 
 
16
  },
17
  {
18
  "name": "Indigenous Languages Funding",
19
  "description": "Supports the preservation and revitalization of Indigenous languages in Canada.",
20
  "deadline": "Annual - April 30",
21
- "focus": "Language documentation, teaching resources, immersion programs"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  },
23
  {
24
  "name": "Emergency Management Assistance Program",
25
  "description": "Helps First Nations prepare for and respond to emergencies affecting reserves.",
26
  "deadline": "Ongoing",
27
- "focus": "Emergency preparedness, response, and recovery"
 
 
28
  },
29
  {
30
  "name": "First Nation Infrastructure Fund",
31
  "description": "Supports community infrastructure projects on reserve lands.",
32
  "deadline": "Annual - October 31",
33
- "focus": "Community infrastructure improvements"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
  ]
36
 
@@ -46,7 +96,7 @@ def generate_proposal(program_name, context_info):
46
  return "Please select a funding program first."
47
 
48
  # Generate proposal based on selected program and additional info
49
- proposal = f"""# Funding Proposal: {selected_program['name']}
50
 
51
  ## Program Information
52
  - **Program:** {selected_program['name']}
@@ -114,6 +164,52 @@ body {
114
  }
115
  """
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  # Create Gradio interface
118
  with gr.Blocks(css=css) as demo:
119
  # App header
@@ -121,7 +217,7 @@ with gr.Blocks(css=css) as demo:
121
  """
122
  <div class="header">
123
  <h1 style="margin: 0; font-size: 2em; color: white;">Funding Proposal Generator</h1>
124
- <p style="margin: 5px 0 0 0; color: white;">Find opportunities from <a href="https://www.sac-isc.gc.ca" style="color: white; text-decoration: underline;">https://www.sac-isc.gc.ca</a> and create funding proposals</p>
125
  </div>
126
  """
127
  )
@@ -137,6 +233,8 @@ with gr.Blocks(css=css) as demo:
137
  <p><strong>Description:</strong> {program['description']}</p>
138
  <p><strong>Deadline:</strong> {program['deadline']}</p>
139
  <p><strong>Focus:</strong> {program['focus']}</p>
 
 
140
  </div>
141
  """
142
  opportunities_html += "</div>"
@@ -162,7 +260,7 @@ with gr.Blocks(css=css) as demo:
162
  )
163
 
164
  # Step 4: Generate proposal
165
- gr.HTML(' <div class="step-header"><h2 style="margin: 0; font-size: 1.3em; color: white;">Step 4: Generate Funding Proposal</h2></div>')
166
 
167
  generate_button = gr.Button("Generate Proposal", elem_classes=["generate-button"])
168
 
 
6
  "name": "Education Partnerships Program",
7
  "description": "Promotes collaboration between First Nations, provinces, ISC and other stakeholders to advance First Nations education.",
8
  "deadline": "Annual - February 28",
9
+ "focus": "K-12 education systems collaboration",
10
+ "amount": "$50,000 - $150,000",
11
+ "source": "https://www.sac-isc.gc.ca/eng/1100100033760/1531318318178"
12
  },
13
  {
14
  "name": "Post-Secondary Partnerships Program",
15
  "description": "Supports projects that develop and deliver college/university programs for Indigenous students.",
16
  "deadline": "Annual - December 15",
17
+ "focus": "Post-secondary education development",
18
+ "amount": "$75,000 - $200,000",
19
+ "source": "https://www.sac-isc.gc.ca/eng/1100100033691/1100100033692"
20
  },
21
  {
22
  "name": "Indigenous Languages Funding",
23
  "description": "Supports the preservation and revitalization of Indigenous languages in Canada.",
24
  "deadline": "Annual - April 30",
25
+ "focus": "Language documentation, teaching resources, immersion programs",
26
+ "amount": "$25,000 - $100,000",
27
+ "source": "https://www.sac-isc.gc.ca/eng/1524506968524/1557512776453"
28
+ },
29
+ {
30
+ "name": "Innovation in Education Program",
31
+ "description": "Funds innovative approaches to Indigenous education and learning methodologies.",
32
+ "deadline": "Annual - April 30, 2025",
33
+ "focus": "Educational innovation, technology integration, traditional knowledge",
34
+ "amount": "$20,000 - $75,000",
35
+ "source": "https://www.sac-isc.gc.ca/eng/1611847976350/1611848008035"
36
+ },
37
+ {
38
+ "name": "First Nations and Inuit Cultural Education Centres",
39
+ "description": "Supports cultural education centers that preserve and promote Indigenous heritage.",
40
+ "deadline": "Annual - May 5, 2025",
41
+ "focus": "Cultural preservation, educational programming, community engagement",
42
+ "amount": "$50,000 - $150,000",
43
+ "source": "https://www.sac-isc.gc.ca/eng/1100100033700/1531425361344"
44
  },
45
  {
46
  "name": "Emergency Management Assistance Program",
47
  "description": "Helps First Nations prepare for and respond to emergencies affecting reserves.",
48
  "deadline": "Ongoing",
49
+ "focus": "Emergency preparedness, response, and recovery",
50
+ "amount": "$10,000 - $100,000",
51
+ "source": "https://www.sac-isc.gc.ca/eng/1534954090122/1535120506707"
52
  },
53
  {
54
  "name": "First Nation Infrastructure Fund",
55
  "description": "Supports community infrastructure projects on reserve lands.",
56
  "deadline": "Annual - October 31",
57
+ "focus": "Community infrastructure improvements",
58
+ "amount": "$100,000 - $500,000",
59
+ "source": "https://www.sac-isc.gc.ca/eng/1100100010656/1533645154710"
60
+ },
61
+ {
62
+ "name": "Community Opportunity Readiness Program",
63
+ "description": "Supports First Nations and Inuit communities with economic opportunities and business development.",
64
+ "deadline": "Ongoing",
65
+ "focus": "Project development, business plans, marketing",
66
+ "amount": "$25,000 - $250,000",
67
+ "source": "https://www.sac-isc.gc.ca/eng/1587563567774/1587563589262"
68
+ },
69
+ {
70
+ "name": "Family Violence Prevention Program",
71
+ "description": "Supports family violence prevention projects in First Nations communities.",
72
+ "deadline": "Annual - January 15",
73
+ "focus": "Prevention, awareness, shelter services",
74
+ "amount": "$15,000 - $75,000",
75
+ "source": "https://www.sac-isc.gc.ca/eng/1100100035253/1533304683142"
76
+ },
77
+ {
78
+ "name": "First Nations Environmental Contaminants Program",
79
+ "description": "Addresses concerns about human exposure to environmental contaminants.",
80
+ "deadline": "Biennial - September 15",
81
+ "focus": "Research, monitoring, risk assessment",
82
+ "amount": "$50,000 - $125,000",
83
+ "source": "https://www.sac-isc.gc.ca/eng/1583779185601/1583779243216"
84
  }
85
  ]
86
 
 
96
  return "Please select a funding program first."
97
 
98
  # Generate proposal based on selected program and additional info
99
+ proposal = f"""# Research Proposal: {selected_program['name']}
100
 
101
  ## Program Information
102
  - **Program:** {selected_program['name']}
 
164
  }
165
  """
166
 
167
+ # Update the proposal generator function to include funding amount
168
+ def generate_proposal(program_name, context_info):
169
+ selected_program = None
170
+ for program in funding_programs:
171
+ if program["name"] == program_name:
172
+ selected_program = program
173
+ break
174
+
175
+ if not selected_program:
176
+ return "Please select a funding program first."
177
+
178
+ # Generate proposal based on selected program and additional info
179
+ proposal = f"""# Research Proposal: {selected_program['name']}
180
+
181
+ ## Program Information
182
+ - **Program:** {selected_program['name']}
183
+ - **Deadline:** {selected_program['deadline']}
184
+ - **Focus Area:** {selected_program['focus']}
185
+ - **Funding Amount:** {selected_program['amount']}
186
+ - **Source:** {selected_program['source']}
187
+
188
+ ## Project Context
189
+ {context_info}
190
+
191
+ ## Project Objectives
192
+ - Develop innovative approaches to address challenges in {selected_program['focus']}
193
+ - Build capacity within the community and relevant stakeholders
194
+ - Create sustainable outcomes with measurable impacts
195
+ - Document findings and share knowledge to benefit broader community
196
+
197
+ ## Methodology
198
+ The project will employ a mixed-methods approach that centers Indigenous knowledge and perspectives while incorporating relevant best practices from the field. Our methodology will prioritize community engagement, participatory design, and culturally relevant evaluation frameworks.
199
+
200
+ ## Timeline
201
+ - **Months 1-3:** Planning, community engagement, and baseline assessment
202
+ - **Months 4-8:** Implementation of key activities and regular progress monitoring
203
+ - **Months 9-12:** Evaluation, knowledge sharing, and sustainability planning
204
+
205
+ ## Budget Overview
206
+ The requested funding of {selected_program['amount'].split('-')[0]} will support personnel costs (45%), program activities (30%), materials and equipment (15%), and evaluation (10%). This distribution ensures that adequate resources are allocated to support meaningful community engagement while maintaining administrative efficiency.
207
+
208
+ ## Expected Outcomes
209
+ This initiative will directly address community needs related to {selected_program['focus'].lower()}, resulting in tangible benefits including improved services, enhanced capacity, and strengthened community connections. Long-term impacts will include sustained improvements in {selected_program['focus'].lower()} outcomes and enhanced community resilience.
210
+ """
211
+ return proposal
212
+
213
  # Create Gradio interface
214
  with gr.Blocks(css=css) as demo:
215
  # App header
 
217
  """
218
  <div class="header">
219
  <h1 style="margin: 0; font-size: 2em; color: white;">Funding Proposal Generator</h1>
220
+ <p style="margin: 5px 0 0 0; color: white;">Find opportunities from <a href="https://www.sac-isc.gc.ca" style="color: white; text-decoration: underline;">https://www.sac-isc.gc.ca</a> and create research proposals</p>
221
  </div>
222
  """
223
  )
 
233
  <p><strong>Description:</strong> {program['description']}</p>
234
  <p><strong>Deadline:</strong> {program['deadline']}</p>
235
  <p><strong>Focus:</strong> {program['focus']}</p>
236
+ <p><strong>Funding Amount:</strong> {program['amount']}</p>
237
+ <p><strong>Source:</strong> <a href="{program['source']}" target="_blank" style="color: #ee5928;">{program['source']}</a></p>
238
  </div>
239
  """
240
  opportunities_html += "</div>"
 
260
  )
261
 
262
  # Step 4: Generate proposal
263
+ gr.HTML(' <div class="step-header"><h2 style="margin: 0; font-size: 1.3em; color: white;">Step 4: Generate Research Proposal</h2></div>')
264
 
265
  generate_button = gr.Button("Generate Proposal", elem_classes=["generate-button"])
266