Emmanuel Frimpong Asante commited on
Commit
cab20df
·
1 Parent(s): ac8716a

"Update space"

Browse files

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

Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,5 +1,4 @@
1
  import os
2
- import openai
3
  import tensorflow as tf
4
  from keras.models import load_model
5
  import gradio as gr
@@ -88,12 +87,14 @@ class PoultryFarmBot:
88
  # Generate a detailed response using Llama 2 for disease information and recommendations
89
  def generate_disease_response(self, disease_name, status, recommendation):
90
  prompt = (
91
- f"The detected disease is {disease_name}. The condition is {status}. "
92
- f"The recommended action is {recommendation}. "
93
- "Provide detailed information about this disease, including causes, symptoms, "
94
- "and how it can be effectively managed or treated on a poultry farm."
95
  )
96
- return llama2_response(prompt)
 
 
97
 
98
  # Diagnose Disease Using Fecal Image
99
  def diagnose_disease(self, image):
 
1
  import os
 
2
  import tensorflow as tf
3
  from keras.models import load_model
4
  import gradio as gr
 
87
  # Generate a detailed response using Llama 2 for disease information and recommendations
88
  def generate_disease_response(self, disease_name, status, recommendation):
89
  prompt = (
90
+ f"The disease detected is {disease_name}, classified as {status}. "
91
+ f"Recommended action: {recommendation}. "
92
+ f"Here is some information about {disease_name}: causes, symptoms, and treatment methods "
93
+ "to effectively manage this condition on a poultry farm."
94
  )
95
+ response = llama2_response(prompt)
96
+ # Post-process to remove the prompt if accidentally included in the response
97
+ return response.replace(prompt, "").strip()
98
 
99
  # Diagnose Disease Using Fecal Image
100
  def diagnose_disease(self, image):