rushankg commited on
Commit
b988bd1
·
verified ·
1 Parent(s): 7fefb3b

Update memes.py

Browse files
Files changed (1) hide show
  1. memes.py +13 -13
memes.py CHANGED
@@ -10,18 +10,18 @@ IMGFLIP_URL = "https://api.imgflip.com/caption_image"
10
 
11
  # 12 template names → Imgflip template_ids
12
  TEMPLATE_IDS = {
13
- "Drake Hotline Bling": "181913649",
14
- "UNO Draw 25 Cards": "217743513",
15
- "Bernie Asking For Support": "222403160",
16
- "Disaster Girl": "97984",
17
- "Waiting Skeleton": "109765",
18
- "Always Has Been": "252600902",
19
- "Woman Yelling at Cat": "188390779",
20
- "I Bet He's Thinking About Other Women": "110163934",
21
- "One Does Not Simply": "61579",
22
- "Success Kid": "61544",
23
- "Oprah You Get A": "28251713",
24
- "Hide the Pain Harold": "27813981",
25
  }
26
 
27
  # Initialize OpenAI client
@@ -56,7 +56,7 @@ def article_to_meme(article_text: str) -> str:
56
  text1 = match1.group(1).strip()
57
 
58
  # 4) Render meme
59
- tpl_id = TEMPLATE_IDS.get(template)
60
  if not tpl_id:
61
  raise KeyError(f"Unknown template: {template}")
62
  resp = requests.post(
 
10
 
11
  # 12 template names → Imgflip template_ids
12
  TEMPLATE_IDS = {
13
+ "drake hotline bling": "181913649",
14
+ "uno draw 25 cards": "217743513",
15
+ "bernie asking for support": "222403160",
16
+ "disaster girl": "97984",
17
+ "waiting skeleton": "109765",
18
+ "always has been": "252600902",
19
+ "woman yelling at cat": "188390779",
20
+ "i bet he's thinking about other women": "110163934",
21
+ "one does not simply": "61579",
22
+ "success kid": "61544",
23
+ "oprah you get a": "28251713",
24
+ "hide the pain harold": "27813981",
25
  }
26
 
27
  # Initialize OpenAI client
 
56
  text1 = match1.group(1).strip()
57
 
58
  # 4) Render meme
59
+ tpl_id = TEMPLATE_IDS.get(template.lower())
60
  if not tpl_id:
61
  raise KeyError(f"Unknown template: {template}")
62
  resp = requests.post(