haxerwddle commited on
Commit
cf72cf4
·
1 Parent(s): 886596e

UI change

Browse files
Files changed (1) hide show
  1. app.py +20 -10
app.py CHANGED
@@ -34,21 +34,31 @@ 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
53
 
54
  outputs = chat_model.generate(
 
34
  prompt = f"""
35
  You are an expert in waste management.
36
 
37
+ Item: {class_label}
38
 
39
+ Your task is to produce EXACTLY TWO sections:
 
 
40
 
41
+ SECTION 1: "Recycling Instructions"
42
+ - Write exactly 3 bullet points.
43
+ - Each bullet point MUST start with "- ".
44
+ - Each bullet point MUST be on its own line.
 
45
 
46
+ SECTION 2: "Waste Reduction Tips"
47
+ - Write exactly 3 bullet points.
48
+ - Each bullet point MUST start with "- ".
49
+ - Each bullet point MUST be on its own line.
50
+
51
+ Important rules:
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(