Spaces:
Sleeping
Sleeping
Patryk Studzinski commited on
Commit ·
baa08b7
1
Parent(s): 9d2cc15
add get_info method to return model details for /models endpoint
Browse files
app/models/llama_cpp_model.py
CHANGED
|
@@ -114,6 +114,18 @@ class LlamaCppModel(BaseLLM):
|
|
| 114 |
|
| 115 |
return response_text
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
async def cleanup(self) -> None:
|
| 118 |
"""Free memory."""
|
| 119 |
if self.llm:
|
|
|
|
| 114 |
|
| 115 |
return response_text
|
| 116 |
|
| 117 |
+
def get_info(self) -> Dict[str, Any]:
|
| 118 |
+
"""Return model information for /models endpoint."""
|
| 119 |
+
return {
|
| 120 |
+
"name": self.name,
|
| 121 |
+
"model_id": self.model_id,
|
| 122 |
+
"type": "gguf",
|
| 123 |
+
"backend": "llama.cpp",
|
| 124 |
+
"context_length": self.n_ctx,
|
| 125 |
+
"loaded": self._initialized,
|
| 126 |
+
"model_path": self.model_path
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
async def cleanup(self) -> None:
|
| 130 |
"""Free memory."""
|
| 131 |
if self.llm:
|