sandrocalzada commited on
Commit
9a1c304
verified
1 Parent(s): 6094276

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -7,6 +7,9 @@ import pandas as pd
7
  genai.configure(api_key="AIzaSyA7tPavobVN5_3-BJ0qhFT5HVjO4V19QWk")
8
 
9
  def ImageChat(image):
 
 
 
10
  # Lista de preguntas preconfiguradas
11
  questions = [
12
  "驴La persona est谩 utilizando auriculares?",
@@ -29,7 +32,8 @@ def ImageChat(image):
29
 
30
  # Process each question
31
  for question in questions:
32
- response = model.generate_content([question, img])
 
33
  results.append(response.text)
34
 
35
  # Create a DataFrame to display results as a table
@@ -46,4 +50,4 @@ app = gr.Interface(
46
  theme="Taithrah/Minimal"
47
  )
48
 
49
- app.launch()
 
7
  genai.configure(api_key="AIzaSyA7tPavobVN5_3-BJ0qhFT5HVjO4V19QWk")
8
 
9
  def ImageChat(image):
10
+ # Configuraci贸n de la personalidad del sistema
11
+ system_prompt = "Eres un asistente que analiza im谩genes e intenta siempre dar una respuesta positiva o negativa ante la pregunta aunque no se tenga la seguridad o la imagen no sea perfecta"
12
+
13
  # Lista de preguntas preconfiguradas
14
  questions = [
15
  "驴La persona est谩 utilizando auriculares?",
 
32
 
33
  # Process each question
34
  for question in questions:
35
+ full_prompt = f"{system_prompt}\n\n{question}"
36
+ response = model.generate_content([full_prompt, img])
37
  results.append(response.text)
38
 
39
  # Create a DataFrame to display results as a table
 
50
  theme="Taithrah/Minimal"
51
  )
52
 
53
+ app.launch()