Upload intrinsic README.
Browse files
README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
# stembolts Intrinsic Adapter
|
| 2 |
|
| 3 |
-
This intrinsic adapter is designed to diagnose and predict potential issues
|
| 4 |
|
| 5 |
## Training Data
|
| 6 |
|
| 7 |
-
The training dataset consists of JSONL formatted
|
| 8 |
|
| 9 |
### Examples
|
| 10 |
|
|
@@ -68,14 +68,14 @@ class StemboltsAdapter(CustomGraniteCommonAdapter):
|
|
| 68 |
|
| 69 |
|
| 70 |
class StemboltsIntrinsic(Intrinsic, SimpleComponent):
|
| 71 |
-
def __init__(self, description: str):
|
| 72 |
Intrinsic.__init__(self, intrinsic_name=_INTRINSIC_ADAPTER_NAME)
|
| 73 |
SimpleComponent.__init__(self, mechanic_notes=mechanic_notes)
|
| 74 |
|
| 75 |
def format_for_llm(self):
|
| 76 |
return SimpleComponent.format_for_llm(self)
|
| 77 |
|
| 78 |
-
async def async_stembolts(description: str, ctx: Context, backend: Backend | AdapterMixin):
|
| 79 |
# Backend.add_adapter should be idempotent, but we'll go ahead and check just in case.
|
| 80 |
if adapter.qualified_name not in backend.list_adapters():
|
| 81 |
backend.add_adapter(StemboltsAdapter(backend.base_model_name))
|
|
@@ -84,11 +84,21 @@ async def async_stembolts(description: str, ctx: Context, backend: Backend | Ada
|
|
| 84 |
return mot
|
| 85 |
|
| 86 |
|
| 87 |
-
def stembolts(description: str, ctx: Context, backend: Backend | AdapterMixin):
|
| 88 |
# Backend.add_adapter should be idempotent, but we'll go ahead and check just in case.
|
| 89 |
adapter = StemboltsAdapter(backend.base_model_name)
|
| 90 |
if adapter.qualified_name not in backend.list_adapters():
|
| 91 |
backend.add_adapter(adapter)
|
| 92 |
action = StemboltsIntrinsic(notes)
|
| 93 |
return mfuncs.act(action, ctx, backend)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
```
|
|
|
|
| 1 |
# stembolts Intrinsic Adapter
|
| 2 |
|
| 3 |
+
This intrinsic adapter is designed to diagnose and predict potential issues within internal combustion engines based on a variety of symptoms described in plain text. It uses a trained model to analyze these descriptions and identify the most likely defective part, along with an associated likelihood score.
|
| 4 |
|
| 5 |
## Training Data
|
| 6 |
|
| 7 |
+
The training dataset consists of JSONL formatted records where each record contains a free-form text description of engine issues and a corresponding labeled response indicating the suspected defective part and its diagnostic likelihood.
|
| 8 |
|
| 9 |
### Examples
|
| 10 |
|
|
|
|
| 68 |
|
| 69 |
|
| 70 |
class StemboltsIntrinsic(Intrinsic, SimpleComponent):
|
| 71 |
+
def __init__(self, (description: str) -> Dict[str, float]):
|
| 72 |
Intrinsic.__init__(self, intrinsic_name=_INTRINSIC_ADAPTER_NAME)
|
| 73 |
SimpleComponent.__init__(self, mechanic_notes=mechanic_notes)
|
| 74 |
|
| 75 |
def format_for_llm(self):
|
| 76 |
return SimpleComponent.format_for_llm(self)
|
| 77 |
|
| 78 |
+
async def async_stembolts((description: str) -> Dict[str, float], ctx: Context, backend: Backend | AdapterMixin):
|
| 79 |
# Backend.add_adapter should be idempotent, but we'll go ahead and check just in case.
|
| 80 |
if adapter.qualified_name not in backend.list_adapters():
|
| 81 |
backend.add_adapter(StemboltsAdapter(backend.base_model_name))
|
|
|
|
| 84 |
return mot
|
| 85 |
|
| 86 |
|
| 87 |
+
def stembolts((description: str) -> Dict[str, float], ctx: Context, backend: Backend | AdapterMixin):
|
| 88 |
# Backend.add_adapter should be idempotent, but we'll go ahead and check just in case.
|
| 89 |
adapter = StemboltsAdapter(backend.base_model_name)
|
| 90 |
if adapter.qualified_name not in backend.list_adapters():
|
| 91 |
backend.add_adapter(adapter)
|
| 92 |
action = StemboltsIntrinsic(notes)
|
| 93 |
return mfuncs.act(action, ctx, backend)
|
| 94 |
+
|
| 95 |
+
if __name__ == "__main__":
|
| 96 |
+
from mellea.backends.huggingface import LocalHFBackend
|
| 97 |
+
from mellea.backends.model_ids import IBM_GRANITE_4_MICRO_3B
|
| 98 |
+
from mellea.stdlib.context import ChatContext
|
| 99 |
+
backend = LocalHFBackend(IBM_GRANITE_4_MICRO_3B)
|
| 100 |
+
# Example inputs: Airflow to the intake seems restricted; it bogs under throttle.
|
| 101 |
+
# Example outputs: {"defective_part":"air filter","diag_likelihood":0.78}
|
| 102 |
+
result, ctx = stembolts(..., ctx=ChatContext(), backend=backend)
|
| 103 |
+
print(result.value)
|
| 104 |
```
|