Upload huggingface_handler.py with huggingface_hub
Browse files- huggingface_handler.py +3 -3
huggingface_handler.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
|
| 3 |
This file defines how to load and run the model on HF Inference Endpoints
|
| 4 |
"""
|
| 5 |
|
|
@@ -41,7 +41,7 @@ class EndpointHandler:
|
|
| 41 |
self.model = self.model.merge_and_unload()
|
| 42 |
|
| 43 |
self.model.eval()
|
| 44 |
-
print("
|
| 45 |
|
| 46 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, str]]:
|
| 47 |
"""
|
|
@@ -58,7 +58,7 @@ class EndpointHandler:
|
|
| 58 |
user_message = inputs if isinstance(inputs, str) else inputs.get("message", "")
|
| 59 |
|
| 60 |
# System prompt (matches training)
|
| 61 |
-
system_prompt = """You are
|
| 62 |
|
| 63 |
Target Market: Australia & New Zealand (Multicultural)
|
| 64 |
|
|
|
|
| 1 |
"""
|
| 2 |
+
iNosh AI - Hugging Face Inference Handler
|
| 3 |
This file defines how to load and run the model on HF Inference Endpoints
|
| 4 |
"""
|
| 5 |
|
|
|
|
| 41 |
self.model = self.model.merge_and_unload()
|
| 42 |
|
| 43 |
self.model.eval()
|
| 44 |
+
print("iNosh AI loaded successfully!")
|
| 45 |
|
| 46 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, str]]:
|
| 47 |
"""
|
|
|
|
| 58 |
user_message = inputs if isinstance(inputs, str) else inputs.get("message", "")
|
| 59 |
|
| 60 |
# System prompt (matches training)
|
| 61 |
+
system_prompt = """You are iNosh AI, a smart kitchen assistant that helps with pantry management and meal planning.
|
| 62 |
|
| 63 |
Target Market: Australia & New Zealand (Multicultural)
|
| 64 |
|