Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,44 +56,30 @@ def get_vector_store(text_chunks):
|
|
56 |
|
57 |
def get_conversational_chain():
|
58 |
prompt_template = """
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
- **Waste Type 1**: Explanation of its use and benefits in the {industry_name} industry.
|
79 |
-
- **Waste Type 2**: Explanation of its use and benefits in the {industry_name} industry.
|
80 |
-
|
81 |
-
**Estimated Savings:**
|
82 |
-
- **Waste Type 1**: By using [Waste Type 1] instead of [corresponding raw material], you could save approximately [savings percentage or amount, e.g., 20-30% of material costs].
|
83 |
-
- **Waste Type 2**: By reusing [Waste Type 2], the industry could reduce costs by around [estimated savings figure, based on common industry benchmarks].
|
84 |
-
|
85 |
-
**Benefits of Using Waste:**
|
86 |
-
1. Environmental Impact: Describe how repurposing waste helps reduce environmental impact or waste disposal requirements.
|
87 |
-
2. Compliance: Explain any regulatory benefits, such as meeting industry waste reduction standards.
|
88 |
-
3. Brand Image: Highlight how adopting sustainable practices enhances public perception or brand value.
|
89 |
-
|
90 |
-
Begin your response now.
|
91 |
-
"""
|
92 |
model = ChatGoogleGenerativeAI(model="gemini-pro", temperature=0.3)
|
93 |
prompt = PromptTemplate(template=prompt_template, input_variables=["context", "question"])
|
94 |
chain = load_qa_chain(model, chain_type="stuff", prompt=prompt)
|
95 |
-
|
96 |
return chain
|
|
|
97 |
|
98 |
def user_input(user_question):
|
99 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001", google_api_key=GOOGLE_API_KEY)
|
|
|
56 |
|
57 |
def get_conversational_chain():
|
58 |
prompt_template = """
|
59 |
+
{context}
|
60 |
+
|
61 |
+
You are an expert waste management advisor, specializing in helping businesses in various industries optimize their use of waste materials. Your role is to:
|
62 |
+
1. Recommend types of waste materials that could be beneficial or reusable in the specified industry.
|
63 |
+
2. Estimate potential cost savings from using waste materials instead of raw materials.
|
64 |
+
3. Highlight additional benefits of using waste materials, such as environmental impact, regulatory compliance, or brand enhancement.
|
65 |
+
|
66 |
+
Consider the specific needs of the industry, typical waste materials, and potential areas for savings when providing your suggestions.
|
67 |
+
|
68 |
+
## Task:
|
69 |
+
{question}
|
70 |
+
|
71 |
+
Provide a detailed response with:
|
72 |
+
1. **Types of Waste That May Be Useful**: Include how each type of waste can be repurposed in this industry.
|
73 |
+
2. **Estimated Savings**: Calculate or estimate potential cost savings from using the suggested waste materials instead of raw materials. Mention approximate savings based on typical industry metrics or scenarios.
|
74 |
+
3. **Benefits of Using Waste**: Describe any additional advantages, such as sustainability, compliance with regulations, or brand reputation enhancement.
|
75 |
+
|
76 |
+
Begin your response now.
|
77 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
model = ChatGoogleGenerativeAI(model="gemini-pro", temperature=0.3)
|
79 |
prompt = PromptTemplate(template=prompt_template, input_variables=["context", "question"])
|
80 |
chain = load_qa_chain(model, chain_type="stuff", prompt=prompt)
|
|
|
81 |
return chain
|
82 |
+
|
83 |
|
84 |
def user_input(user_question):
|
85 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001", google_api_key=GOOGLE_API_KEY)
|