Spaces:
Sleeping
Sleeping
sandrocalzada
commited on
Update app.py
Browse files
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 |
-
|
|
|
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()
|