Update app.py
Browse files
app.py
CHANGED
@@ -98,15 +98,15 @@ class PoultryFarmBot:
|
|
98 |
|
99 |
# Diagnose Disease Using Fecal Image
|
100 |
def diagnose_disease(self, image):
|
101 |
-
if image is not None and image.size > 0: # Ensure image is valid and has elements
|
102 |
return self.predict(image)
|
103 |
-
return "Please provide an image of poultry
|
104 |
|
105 |
# Initialize the bot instance
|
106 |
bot = PoultryFarmBot()
|
107 |
|
108 |
-
# Load Llama 2 model and tokenizer for text generation
|
109 |
-
model_name = "meta-llama/Llama-2-
|
110 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
111 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
112 |
|
|
|
98 |
|
99 |
# Diagnose Disease Using Fecal Image
|
100 |
def diagnose_disease(self, image):
|
101 |
+
if image is not None and image.size > 0: # Ensure the image is valid and has elements
|
102 |
return self.predict(image)
|
103 |
+
return "Please provide an image of poultry faecal matter for disease detection.", None, None, None
|
104 |
|
105 |
# Initialize the bot instance
|
106 |
bot = PoultryFarmBot()
|
107 |
|
108 |
+
# Load Llama 3.2 model and tokenizer for text generation
|
109 |
+
model_name = "meta-llama/Llama-3.2-1B"
|
110 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
111 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
112 |
|