haxerwddle commited on
Commit
3b56279
·
1 Parent(s): cf72cf4

UI change

Browse files
Files changed (1) hide show
  1. app.py +18 -20
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 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(
 
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(