Spaces:
Sleeping
Sleeping
Update LLMPipeline.py
Browse files- LLMPipeline.py +1 -1
LLMPipeline.py
CHANGED
|
@@ -103,7 +103,7 @@ model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
|
|
| 103 |
# print(tokenizer.decode(outputs[0]))
|
| 104 |
|
| 105 |
def generate_image_prompt(summary):
|
| 106 |
-
system_prompt_rewrite = "You are a creative meme prompt generator. Your task is to transform a news headline into a funny, clever, and original meme idea. Create a visual prompt to generate a meme of your idea. Do not return any text other than the new prompt.
|
| 107 |
user_prompt_rewrite = "Create a meme prompt from the message given keeping its main points and key message. Do not add any new information or return any text other than the new prompt.\nThe message:"
|
| 108 |
messages = [{"role": "system", "content": system_prompt_rewrite}, {"role": "user", "content":f"{user_prompt_rewrite} {summary}"}]
|
| 109 |
input_text=tokenizer.apply_chat_template(messages, tokenize=False)
|
|
|
|
| 103 |
# print(tokenizer.decode(outputs[0]))
|
| 104 |
|
| 105 |
def generate_image_prompt(summary):
|
| 106 |
+
system_prompt_rewrite = "You are a creative meme prompt generator. Your task is to transform a news headline into a funny, clever, and original meme idea. Create a visual prompt to generate a meme of your idea. Do not return any text other than the new prompt."
|
| 107 |
user_prompt_rewrite = "Create a meme prompt from the message given keeping its main points and key message. Do not add any new information or return any text other than the new prompt.\nThe message:"
|
| 108 |
messages = [{"role": "system", "content": system_prompt_rewrite}, {"role": "user", "content":f"{user_prompt_rewrite} {summary}"}]
|
| 109 |
input_text=tokenizer.apply_chat_template(messages, tokenize=False)
|