abhidgp1978 commited on
Commit
ff7f4f5
·
verified ·
1 Parent(s): 0a5649f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -46,11 +46,9 @@ def generate_reason(product_desc, channel):
46
  if not reasoning_model:
47
  return "⚠️ Reasoning model not loaded. Cannot generate a reason."
48
 
49
- prompt = f"""
50
- You are a social media marketing expert.
51
- Based on the following product, write a brief, actionable marketing strategy for the {channel} platform. Focus on the content format, target audience, and potential influencer collaborations.
52
- Product: {product_desc}
53
- """
54
  try:
55
  out = reasoning_model(prompt, max_new_tokens=120, truncation=True)
56
  return out[0]["generated_text"].strip()
@@ -167,7 +165,8 @@ def suggest_channels(product_desc, region_code):
167
  reason = generate_reason(product_desc, channel)
168
 
169
  # Build a search query to find relevant influencers and content.
170
- query = f"top {channel} content and influencers for {product_desc} in {region_code}"
 
171
  site_filter = channel.lower() + ".com" if channel != "YouTube" else None
172
 
173
  # Get relevant links from the respective search API.
 
46
  if not reasoning_model:
47
  return "⚠️ Reasoning model not loaded. Cannot generate a reason."
48
 
49
+ # New, simpler prompt to avoid repetition.
50
+ prompt = f"As a social media marketing expert, provide a brief, actionable marketing strategy for {product_desc} on {channel}."
51
+
 
 
52
  try:
53
  out = reasoning_model(prompt, max_new_tokens=120, truncation=True)
54
  return out[0]["generated_text"].strip()
 
165
  reason = generate_reason(product_desc, channel)
166
 
167
  # Build a search query to find relevant influencers and content.
168
+ # New, more concise query to get better search results.
169
+ query = f"{product_desc} {channel} influencers"
170
  site_filter = channel.lower() + ".com" if channel != "YouTube" else None
171
 
172
  # Get relevant links from the respective search API.