Emmanuel Frimpong Asante
commited on
Commit
·
cab20df
1
Parent(s):
ac8716a
"Update space"
Browse filesSigned-off-by: Emmanuel Frimpong Asante <[email protected]>
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
|
92 |
-
f"
|
93 |
-
"
|
94 |
-
"
|
95 |
)
|
96 |
-
|
|
|
|
|
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):
|