caddis commited on
Commit
f7ed6e0
·
1 Parent(s): 39009df

update to natural history

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -55,12 +55,12 @@ additional_models = [
55
  # Calculate all models once
56
  all_models_list = preferred_models_auth + additional_models
57
 
58
- def get_sys_prompt(length="medium", photograph=False,filename=""):
59
  extra_prompt = ""
60
 
61
- if photograph:
62
- object_type = "wildlife photography"
63
- extra_prompt = " Do not guess the exact species of the animals in the photograph unless you are certain - simply use a broader terms to make less errors e.g. say Swan rather mute Swan or Whooper Swan unless you are certain."
64
  else:
65
  object_type = "museum objects"
66
 
@@ -217,7 +217,7 @@ def create_demo():
217
  )
218
 
219
  content_type = gr.Radio(
220
- choices=["Museum Object", "Photography"],
221
  label="Content Type",
222
  value="Museum Object"
223
  )
@@ -294,7 +294,7 @@ def create_demo():
294
  return gr.Dropdown(choices=preferred_choices, value=current_model)
295
  else:
296
  # Reset to default model if current model is not in preferred models
297
- return gr.Dropdown(choices=preferred_choices, value=default_model)
298
 
299
  # Update model info when model selection changes
300
  def update_model_info(model_value):
@@ -348,8 +348,7 @@ def create_demo():
348
  if not image_paths:
349
  return [], [], 0, None, "0 of 0", "No images uploaded to analyze.", None
350
 
351
- is_photography = content_type_choice == "Photography"
352
- sys_prompt = get_sys_prompt(length_choice, photograph=is_photography)
353
  image_results = []
354
  analysis_progress = gr.Progress(track_tqdm=True)
355
 
 
55
  # Calculate all models once
56
  all_models_list = preferred_models_auth + additional_models
57
 
58
+ def get_sys_prompt(length="medium", nat_hist=False,filename=""):
59
  extra_prompt = ""
60
 
61
+ if nat_hist:
62
+ object_type = "Natural History Images"
63
+ extra_prompt = " Do not guess the exact species of the animal in the image unless you are certain - simply use a broader terms to make less errors e.g. say Swan rather mute Swan or Whooper Swan unless you are certain."
64
  else:
65
  object_type = "museum objects"
66
 
 
217
  )
218
 
219
  content_type = gr.Radio(
220
+ choices=["Museum Object", "Natural History"],
221
  label="Content Type",
222
  value="Museum Object"
223
  )
 
294
  return gr.Dropdown(choices=preferred_choices, value=current_model)
295
  else:
296
  # Reset to default model if current model is not in preferred models
297
+ return gr.Dropdown(choices=preferred_choices, value="google/gemini-2.0-flash-001")
298
 
299
  # Update model info when model selection changes
300
  def update_model_info(model_value):
 
348
  if not image_paths:
349
  return [], [], 0, None, "0 of 0", "No images uploaded to analyze.", None
350
 
351
+ sys_prompt = get_sys_prompt(length_choice, nat_hist= content_type_choice == "Natural History")
 
352
  image_results = []
353
  analysis_progress = gr.Progress(track_tqdm=True)
354