Docfile commited on
Commit
32cfa0c
·
verified ·
1 Parent(s): 873b33f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -27,16 +27,18 @@ 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
- model = genai.GenerativeModel(
31
  model_name="gemini-1.5-flash-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
- return response.text
 
 
38
  except Exception as e:
39
- return str(e)
40
 
41
  # Fonction pour interroger Qwen2
42
  def query_qwen2(image_path, question):
 
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-flash-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
+ return response
40
  except Exception as e:
41
+ return "Non disponible pour l'instant"
42
 
43
  # Fonction pour interroger Qwen2
44
  def query_qwen2(image_path, question):