haxerwddle commited on
Commit
5c8319a
·
1 Parent(s): 45441c5

prompt model change

Browse files
Files changed (1) hide show
  1. app.py +17 -6
app.py CHANGED
@@ -40,13 +40,24 @@ chat_model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-base")
40
 
41
  def explain_recycling(class_label):
42
  prompt = f"""
43
- waste item: {class_label}.
44
- Provide the answer including:
45
-
46
- - trash type
47
- - recycling method
48
- - tip
 
 
 
 
 
 
 
 
 
 
49
  """
 
50
  inputs = tokenizer(prompt, return_tensors="pt").input_ids
51
 
52
  outputs = chat_model.generate(
 
40
 
41
  def explain_recycling(class_label):
42
  prompt = f"""
43
+ Example 1:
44
+ Item: banana peel
45
+ • Recycling type: Organic
46
+ Disposal: Compost or food-waste bin
47
+ Processing: Decomposes in composting facilities
48
+ Tip: Use a home composter
49
+
50
+ Example 2:
51
+ Item: aluminum can
52
+ • Recycling type: Metal
53
+ • Disposal: Rinse and place in metal recycling
54
+ • Processing: Melted and recast into new cans
55
+ • Tip: Crush cans to save space
56
+
57
+ Now answer in the same 4-bullet format for:
58
+ Item: {class_label}
59
  """
60
+
61
  inputs = tokenizer(prompt, return_tensors="pt").input_ids
62
 
63
  outputs = chat_model.generate(