Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -41,21 +41,27 @@ MONGO_URI = f"mongodb+srv://{user}:{password}@{cluster}/{db_name}?retryWrites=tr
|
|
41 |
|
42 |
# =================== Prompt ===================
|
43 |
grantbuddy_prompt = PromptTemplate.from_template(
|
44 |
-
"""You are Grant Buddy, a specialized
|
45 |
-
|
|
|
46 |
|
47 |
-
Use the following context to answer the question.
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
CONTEXT:
|
50 |
{context}
|
51 |
|
52 |
QUESTION:
|
53 |
{question}
|
54 |
-
|
55 |
-
Respond truthfully. If the answer is not available, say "This information is not available in the current context."
|
56 |
"""
|
57 |
)
|
58 |
|
|
|
59 |
# =================== Vector Search Setup ===================
|
60 |
@st.cache_resource
|
61 |
def init_embedding_model():
|
|
|
41 |
|
42 |
# =================== Prompt ===================
|
43 |
grantbuddy_prompt = PromptTemplate.from_template(
|
44 |
+
"""You are Grant Buddy, a specialized language model fine-tuned with instruction-tuning and Reinforcement Learning from Human Feedback (RLHF).
|
45 |
+
Your primary role is to assist in crafting compelling, accurate, and mission-aligned grant applications for a social entrepreneurship training and edtech nonprofit
|
46 |
+
focused on combating systemic poverty through education, technology, social innovation, and entrepreneurship for BIPOC and marginalized communities.
|
47 |
|
48 |
+
Use the following context to answer the question. Follow these instructions:
|
49 |
+
|
50 |
+
1. Begin with brief background context and reasoning.
|
51 |
+
2. Align responses with the organization's mission (social entrepreneurship, tech, BIPOC empowerment).
|
52 |
+
3. Use structured formatting (headings, lists, etc.).
|
53 |
+
4. Include examples, impact stories, or strategic alignment when relevant.
|
54 |
+
5. If no answer is found, say: "This information is not available in the current context."
|
55 |
|
56 |
CONTEXT:
|
57 |
{context}
|
58 |
|
59 |
QUESTION:
|
60 |
{question}
|
|
|
|
|
61 |
"""
|
62 |
)
|
63 |
|
64 |
+
|
65 |
# =================== Vector Search Setup ===================
|
66 |
@st.cache_resource
|
67 |
def init_embedding_model():
|