Update app.py
Browse files
app.py
CHANGED
@@ -27,16 +27,15 @@ genai.configure(api_key=GOOGLE_API_KEY)
|
|
27 |
# Fonction pour interroger Gemini
|
28 |
def query_gemini(image_path,prompt_gemini):
|
29 |
img = PIL.Image.open(image_path)
|
30 |
-
|
31 |
-
model_name="gemini-1.5-
|
32 |
generation_config=generation_config,
|
33 |
safety_settings=safety_settings
|
34 |
)
|
35 |
try:
|
36 |
-
|
37 |
-
response = "Non disponible pour l'instant"
|
38 |
-
|
39 |
-
return response
|
40 |
except Exception as e:
|
41 |
return "Non disponible pour l'instant"
|
42 |
|
|
|
27 |
# Fonction pour interroger Gemini
|
28 |
def query_gemini(image_path,prompt_gemini):
|
29 |
img = PIL.Image.open(image_path)
|
30 |
+
model = genai.GenerativeModel(
|
31 |
+
model_name="gemini-1.5-pro-002",
|
32 |
generation_config=generation_config,
|
33 |
safety_settings=safety_settings
|
34 |
)
|
35 |
try:
|
36 |
+
response = model.generate_content([prompt_gemini, img], request_options={"timeout": 600})
|
37 |
+
#response = "Non disponible pour l'instant"
|
38 |
+
return response.text
|
|
|
39 |
except Exception as e:
|
40 |
return "Non disponible pour l'instant"
|
41 |
|