Emmanuel Frimpong Asante commited on
Commit
2e61d46
·
1 Parent(s): 33ad61c

"Update space"

Browse files

Signed-off-by: Emmanuel Frimpong Asante <[email protected]>

Files changed (2) hide show
  1. .idea/misc.xml +1 -1
  2. app.py +6 -1
.idea/misc.xml CHANGED
@@ -3,5 +3,5 @@
3
  <component name="Black">
4
  <option name="sdkName" value="Python 3.11 (Poultry_Diseases_Detector)" />
5
  </component>
6
- <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (Poultry_Diseases_Detector)" project-jdk-type="Python SDK" />
7
  </project>
 
3
  <component name="Black">
4
  <option name="sdkName" value="Python 3.11 (Poultry_Diseases_Detector)" />
5
  </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (Poultry_Diseases_Detector)" project-jdk-type="Python SDK" />
7
  </project>
app.py CHANGED
@@ -62,12 +62,17 @@ def combined_interface(image, text):
62
  return "Please provide an image or ask a question."
63
 
64
 
 
 
 
 
 
65
  # Create Gradio interface
66
  interface = gr.Interface(
67
  fn=combined_interface,
68
  inputs=[gr.Image(label='Upload Image'), gr.Textbox(label='Ask a question')],
69
  outputs=gr.Textbox(label="Response"),
70
- examples=[['examples/disease.jpg', ''], ['', 'What should I do if my chicken is sick?']]
71
  )
72
 
73
  # Launch the interface
 
62
  return "Please provide an image or ask a question."
63
 
64
 
65
+ # Ensure the example file paths are correct and point to actual files
66
+ example_image_path = '/home/user/app/disease.jpg' # Adjust the path to the actual location of the file
67
+ if not os.path.isfile(example_image_path):
68
+ raise FileNotFoundError(f"Example image file not found: {example_image_path}")
69
+
70
  # Create Gradio interface
71
  interface = gr.Interface(
72
  fn=combined_interface,
73
  inputs=[gr.Image(label='Upload Image'), gr.Textbox(label='Ask a question')],
74
  outputs=gr.Textbox(label="Response"),
75
+ examples=[[example_image_path, ''], ['', 'What should I do if my chicken is sick?']]
76
  )
77
 
78
  # Launch the interface