Spaces:
Sleeping
Sleeping
Commit ·
3b56279
1
Parent(s): cf72cf4
UI change
Browse files
app.py
CHANGED
|
@@ -32,33 +32,31 @@ chat_model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large")
|
|
| 32 |
|
| 33 |
def explain_recycling(class_label):
|
| 34 |
prompt = f"""
|
| 35 |
-
You are
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
|
| 42 |
-
-
|
| 43 |
-
-
|
| 44 |
-
-
|
| 45 |
|
| 46 |
-
|
| 47 |
-
-
|
| 48 |
-
-
|
| 49 |
-
-
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
-
|
| 52 |
-
- Do NOT add anything before or after the two sections.
|
| 53 |
-
- Do NOT explain.
|
| 54 |
-
- Do NOT merge bullet points.
|
| 55 |
-
- Do NOT write paragraphs.
|
| 56 |
-
- Only output bullet points.
|
| 57 |
-
|
| 58 |
-
Now produce the two sections for: {class_label}
|
| 59 |
"""
|
| 60 |
|
| 61 |
-
|
| 62 |
inputs = tokenizer(prompt, return_tensors="pt").input_ids
|
| 63 |
|
| 64 |
outputs = chat_model.generate(
|
|
|
|
| 32 |
|
| 33 |
def explain_recycling(class_label):
|
| 34 |
prompt = f"""
|
| 35 |
+
You are a waste management expert.
|
| 36 |
|
| 37 |
+
Fill in the following template for the item: {class_label}
|
| 38 |
|
| 39 |
+
Recycling Instructions:
|
| 40 |
+
- <instruction_1>
|
| 41 |
+
- <instruction_2>
|
| 42 |
+
- <instruction_3>
|
| 43 |
|
| 44 |
+
Waste Reduction Tips:
|
| 45 |
+
- <tip_1>
|
| 46 |
+
- <tip_2>
|
| 47 |
+
- <tip_3>
|
| 48 |
|
| 49 |
+
Rules:
|
| 50 |
+
- Replace ONLY the angle-bracket sections.
|
| 51 |
+
- Do NOT remove the dash at the start of each line.
|
| 52 |
+
- Do NOT add new lines.
|
| 53 |
+
- Do NOT add explanations.
|
| 54 |
+
- Do NOT rewrite section headers.
|
| 55 |
+
- Do NOT output anything else.
|
| 56 |
|
| 57 |
+
Now provide the completed template.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
"""
|
| 59 |
|
|
|
|
| 60 |
inputs = tokenizer(prompt, return_tensors="pt").input_ids
|
| 61 |
|
| 62 |
outputs = chat_model.generate(
|