Emmanuel Frimpong Asante commited on
Commit
bc47f8a
·
1 Parent(s): b6da652

update space

Browse files
requirements.txt CHANGED
@@ -14,3 +14,4 @@ numpy
14
  pillow
15
  huggingface_hub
16
  transformers
 
 
14
  pillow
15
  huggingface_hub
16
  transformers
17
+ keras
services/disease_detection_service.py CHANGED
@@ -88,9 +88,6 @@ def load_llama_model():
88
  logger.error(f"Error loading Llama model: {e}", exc_info=True)
89
  raise RuntimeError("Failed to load Llama model") from e
90
 
91
- # Load models at startup
92
- disease_model = load_disease_model()
93
- llama_model, llama_tokenizer = load_llama_model()
94
 
95
  # Disease mapping and treatment guidelines
96
  # Maps predicted class indices to disease names, status, and treatment recommendations
@@ -186,5 +183,11 @@ class PoultryFarmBot:
186
  # Predict the disease using the disease detection model and return the response
187
  return self.predict_disease(image)
188
 
 
 
 
 
 
189
  # Initialize the bot instance
190
  bot = PoultryFarmBot(db)
 
 
88
  logger.error(f"Error loading Llama model: {e}", exc_info=True)
89
  raise RuntimeError("Failed to load Llama model") from e
90
 
 
 
 
91
 
92
  # Disease mapping and treatment guidelines
93
  # Maps predicted class indices to disease names, status, and treatment recommendations
 
183
  # Predict the disease using the disease detection model and return the response
184
  return self.predict_disease(image)
185
 
186
+ # Load models at startup
187
+ disease_model = load_disease_model()
188
+ llama_model, llama_tokenizer = load_llama_model()
189
+
190
+
191
  # Initialize the bot instance
192
  bot = PoultryFarmBot(db)
193
+