Spaces:
Sleeping
Sleeping
Commit ·
886596e
1
Parent(s): 1048a5e
UI change
Browse files
app.py
CHANGED
|
@@ -32,15 +32,21 @@ chat_model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large")
|
|
| 32 |
|
| 33 |
def explain_recycling(class_label):
|
| 34 |
prompt = f"""
|
| 35 |
-
You are
|
| 36 |
|
| 37 |
-
The
|
| 38 |
-
Provide instruction for the following:
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
|
|
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
"""
|
| 45 |
|
| 46 |
inputs = tokenizer(prompt, return_tensors="pt").input_ids
|
|
|
|
| 32 |
|
| 33 |
def explain_recycling(class_label):
|
| 34 |
prompt = f"""
|
| 35 |
+
You are an expert in waste management.
|
| 36 |
|
| 37 |
+
The item has been identified as: {class_label}
|
|
|
|
| 38 |
|
| 39 |
+
Your task:
|
| 40 |
+
1. Give 2 to 3 clear bullet points explaining how to recycle this item correctly.
|
| 41 |
+
2. Give 2 to 3 clear bullet points explaining how to reduce waste from this item.
|
| 42 |
|
| 43 |
+
Formatting rules:
|
| 44 |
+
- Use simple hyphen bullet points ("- ").
|
| 45 |
+
- Put each bullet point on a new line.
|
| 46 |
+
- Do NOT add introductions, explanations, or extra text.
|
| 47 |
+
- Output only the bullet points.
|
| 48 |
+
|
| 49 |
+
Now provide the bullet points for: {class_label}
|
| 50 |
"""
|
| 51 |
|
| 52 |
inputs = tokenizer(prompt, return_tensors="pt").input_ids
|