Spaces:
Sleeping
Sleeping
Update LLMPipeline.py
Browse files- LLMPipeline.py +3 -3
LLMPipeline.py
CHANGED
|
@@ -78,9 +78,9 @@ def generate_image_prompt_viejo(summary):
|
|
| 78 |
prompt = f"Crea un prompt para imagen tipo meme sobre este titular de noticias:\n{summary}\nEl prompt debe ser corto, visual y gracioso. Devuelve solo el prompt."
|
| 79 |
result = text_generator(prompt, max_new_tokens=400, do_sample=True, temperature=0.7)[0]['generated_text']
|
| 80 |
return result.strip()
|
| 81 |
-
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
| 82 |
-
tokenizer =
|
| 83 |
-
model =
|
| 84 |
|
| 85 |
def generate_image_prompt(summary):
|
| 86 |
input_text = f"Create a prompt for image generation. Should be a meme. Short, visual and funny. Related to: {summary}"
|
|
|
|
| 78 |
prompt = f"Crea un prompt para imagen tipo meme sobre este titular de noticias:\n{summary}\nEl prompt debe ser corto, visual y gracioso. Devuelve solo el prompt."
|
| 79 |
result = text_generator(prompt, max_new_tokens=400, do_sample=True, temperature=0.7)[0]['generated_text']
|
| 80 |
return result.strip()
|
| 81 |
+
# from transformers import T5Tokenizer, T5ForConditionalGeneration
|
| 82 |
+
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")
|
| 83 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")
|
| 84 |
|
| 85 |
def generate_image_prompt(summary):
|
| 86 |
input_text = f"Create a prompt for image generation. Should be a meme. Short, visual and funny. Related to: {summary}"
|