JeCabrera commited on
Commit
476d239
verified
1 Parent(s): 6ba36c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -17,9 +17,9 @@ def get_random_product_mention():
17
  # Elegir una opci贸n al azar bas谩ndose en las probabilidades
18
  return random.choices(mentions, probabilities)[0]
19
 
20
- # Funci贸n para obtener respuesta del modelo Gemini
21
  def get_gemini_response(target_audience, product, text_type, length, mood, model_choice):
22
- product_mention = get_random_product_mention() # Obtener menci贸n de producto aleatoria
 
23
  model = genai.GenerativeModel(model_choice)
24
 
25
  # Crear la instrucci贸n de menci贸n basada en la opci贸n seleccionada
@@ -135,7 +135,7 @@ with col1:
135
  if submit:
136
  if target_audience and product: # Verificar que se haya proporcionado el p煤blico objetivo y el producto
137
  try:
138
- response = get_gemini_response(target_audience, product, product_mention, text_type, length, mood, model_choice)
139
  col2.subheader("Contenido generado:")
140
  col2.write(response)
141
  except ValueError as e:
 
17
  # Elegir una opci贸n al azar bas谩ndose en las probabilidades
18
  return random.choices(mentions, probabilities)[0]
19
 
 
20
  def get_gemini_response(target_audience, product, text_type, length, mood, model_choice):
21
+ # Generar la menci贸n aleatoria
22
+ product_mention = random_product_mention() # Asumiendo que tienes esta funci贸n definida
23
  model = genai.GenerativeModel(model_choice)
24
 
25
  # Crear la instrucci贸n de menci贸n basada en la opci贸n seleccionada
 
135
  if submit:
136
  if target_audience and product: # Verificar que se haya proporcionado el p煤blico objetivo y el producto
137
  try:
138
+ response = get_gemini_response(target_audience, product, text_type, length, mood, model_choice)
139
  col2.subheader("Contenido generado:")
140
  col2.write(response)
141
  except ValueError as e: