Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -510,14 +510,14 @@ IMPORTANT FINAL REMINDER:
|
|
| 510 |
story_instruction = f"{natural_instruction}\n\n{story_instruction}"
|
| 511 |
|
| 512 |
response = model.generate_content([story_instruction])
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
raise ValueError("No se pudo generar la historia")
|
| 522 |
|
| 523 |
# Inicializar la aplicaci贸n Streamlit
|
|
|
|
| 510 |
story_instruction = f"{natural_instruction}\n\n{story_instruction}"
|
| 511 |
|
| 512 |
response = model.generate_content([story_instruction])
|
| 513 |
+
if response and response.parts:
|
| 514 |
+
story = response.parts[0].text.strip()
|
| 515 |
+
# Generar el titular usando la f贸rmula seleccionada
|
| 516 |
+
headline = generate_headline_for_story(model, story, formula_type, product, target_audience, mood)
|
| 517 |
+
# Combinar titular y historia
|
| 518 |
+
if headline:
|
| 519 |
+
return f"# {headline}\n\n{story}"
|
| 520 |
+
return story
|
| 521 |
raise ValueError("No se pudo generar la historia")
|
| 522 |
|
| 523 |
# Inicializar la aplicaci贸n Streamlit
|