Update app.py
Browse files
app.py
CHANGED
|
@@ -7,8 +7,6 @@ client = InferenceClient('Qwen/Qwen2.5-72B-Instruct')
|
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
-
#defining
|
| 11 |
-
cleaned_chunks = []
|
| 12 |
#sustainability tips
|
| 13 |
SUSTAINABILITY_TIPS = [
|
| 14 |
"Bring your own: Carry a reusable water bottle, coffee cup, and shopping bag.",
|
|
@@ -20,8 +18,6 @@ SUSTAINABILITY_TIPS = [
|
|
| 20 |
"Go paperless: Switch to digital bills, receipts, and notes.",
|
| 21 |
"Support eco-conscious brands: Choose companies with ethical sourcing and minimal packaging."
|
| 22 |
]
|
| 23 |
-
cleaned_chunks.extend(SUSTAINABILITY_TIPS)
|
| 24 |
-
|
| 25 |
# Open the ECOsphere.txt file in read mode with UTF-8 encoding
|
| 26 |
with open("eskb.txt", "r", encoding="utf-8") as file:
|
| 27 |
# Read the entire contents of the file and store it in a variable
|
|
@@ -72,6 +68,7 @@ def preprocess_text(text):
|
|
| 72 |
# Return the cleaned_chunks
|
| 73 |
return cleaned_chunks
|
| 74 |
cleaned_chunks = preprocess_text(ECOsphere_text)
|
|
|
|
| 75 |
# Load the pre-trained embedding model that converts text to vectors
|
| 76 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|
| 77 |
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
|
|
|
|
|
|
|
| 10 |
#sustainability tips
|
| 11 |
SUSTAINABILITY_TIPS = [
|
| 12 |
"Bring your own: Carry a reusable water bottle, coffee cup, and shopping bag.",
|
|
|
|
| 18 |
"Go paperless: Switch to digital bills, receipts, and notes.",
|
| 19 |
"Support eco-conscious brands: Choose companies with ethical sourcing and minimal packaging."
|
| 20 |
]
|
|
|
|
|
|
|
| 21 |
# Open the ECOsphere.txt file in read mode with UTF-8 encoding
|
| 22 |
with open("eskb.txt", "r", encoding="utf-8") as file:
|
| 23 |
# Read the entire contents of the file and store it in a variable
|
|
|
|
| 68 |
# Return the cleaned_chunks
|
| 69 |
return cleaned_chunks
|
| 70 |
cleaned_chunks = preprocess_text(ECOsphere_text)
|
| 71 |
+
cleaned_chunks.extend(SUSTAINABILITY_TIPS)
|
| 72 |
# Load the pre-trained embedding model that converts text to vectors
|
| 73 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|
| 74 |
|