Upload audact-stage_b_aug2
Browse files- README.md +4 -4
- audact/__init__.py +3 -0
- {voice_tool_call → audact}/audio_encoder.py +0 -0
- {voice_tool_call → audact}/caller.py +3 -3
- {voice_tool_call → audact}/decode.py +0 -0
- {voice_tool_call → audact}/needle.py +0 -0
- {voice_tool_call → audact}/voice_model.py +0 -0
- inference.py +2 -2
- voice_tool_call/__init__.py +0 -3
README.md
CHANGED
|
@@ -14,9 +14,9 @@ base_model:
|
|
| 14 |
- Cactus-Compute/needle
|
| 15 |
---
|
| 16 |
|
| 17 |
-
#
|
| 18 |
|
| 19 |
-
Speech plus a list of tools in, one tool call (or no call) out, with **no transcript in between**.
|
| 20 |
About 52.6M parameters (211 MB in fp32). English, up to 10 tools per request, one call or none, arguments that are enums,
|
| 21 |
numbers or short strings. Built to work on **tools it never saw in training**.
|
| 22 |
|
|
@@ -42,9 +42,9 @@ pip install -r requirements.txt # needs NeMo for FastConformer's architectur
|
|
| 42 |
```
|
| 43 |
|
| 44 |
```python
|
| 45 |
-
from
|
| 46 |
|
| 47 |
-
caller =
|
| 48 |
tools = [{"name": "set_thermostat", "description": "Set the heating temperature.",
|
| 49 |
"parameters": {"type": "object", "properties": {"degrees": {"type": "integer"}}, "required": ["degrees"]}}]
|
| 50 |
print(caller("command.wav", tools)) # {"name": "set_thermostat", "arguments": {"degrees": 21}} or None
|
|
|
|
| 14 |
- Cactus-Compute/needle
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# Audact (draft)
|
| 18 |
|
| 19 |
+
**Audact** (audio + act): speak a command, get a tool call. Speech plus a list of tools in, one tool call (or no call) out, with **no transcript in between**.
|
| 20 |
About 52.6M parameters (211 MB in fp32). English, up to 10 tools per request, one call or none, arguments that are enums,
|
| 21 |
numbers or short strings. Built to work on **tools it never saw in training**.
|
| 22 |
|
|
|
|
| 42 |
```
|
| 43 |
|
| 44 |
```python
|
| 45 |
+
from audact import Audact
|
| 46 |
|
| 47 |
+
caller = Audact.from_pretrained(".") # a downloaded copy of KishaanG/audact
|
| 48 |
tools = [{"name": "set_thermostat", "description": "Set the heating temperature.",
|
| 49 |
"parameters": {"type": "object", "properties": {"degrees": {"type": "integer"}}, "required": ["degrees"]}}]
|
| 50 |
print(caller("command.wav", tools)) # {"name": "set_thermostat", "arguments": {"degrees": 21}} or None
|
audact/__init__.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .caller import Audact
|
| 2 |
+
|
| 3 |
+
__all__ = ["Audact"]
|
{voice_tool_call → audact}/audio_encoder.py
RENAMED
|
File without changes
|
{voice_tool_call → audact}/caller.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
"""
|
| 2 |
from __future__ import annotations
|
| 3 |
|
| 4 |
import json
|
|
@@ -14,12 +14,12 @@ from .voice_model import VoiceToolModel
|
|
| 14 |
RATE = 16_000
|
| 15 |
|
| 16 |
|
| 17 |
-
class
|
| 18 |
def __init__(self, model: VoiceToolModel, sp, device: str) -> None:
|
| 19 |
self.model, self.sp, self.device = model.eval(), sp, device
|
| 20 |
|
| 21 |
@classmethod
|
| 22 |
-
def from_pretrained(cls, path_or_repo: str, device: str | None = None, revision: str | None = None) ->
|
| 23 |
"""A local folder or a Hugging Face repo id. Needs NeMo for the audio encoder's architecture
|
| 24 |
(pip install "nemo_toolkit[asr]"); its base weights download once, then ours replace them."""
|
| 25 |
import sentencepiece as spm
|
|
|
|
| 1 |
+
"""Audact: speech + a tool list in, one tool call (or none) out. No transcript in between."""
|
| 2 |
from __future__ import annotations
|
| 3 |
|
| 4 |
import json
|
|
|
|
| 14 |
RATE = 16_000
|
| 15 |
|
| 16 |
|
| 17 |
+
class Audact:
|
| 18 |
def __init__(self, model: VoiceToolModel, sp, device: str) -> None:
|
| 19 |
self.model, self.sp, self.device = model.eval(), sp, device
|
| 20 |
|
| 21 |
@classmethod
|
| 22 |
+
def from_pretrained(cls, path_or_repo: str, device: str | None = None, revision: str | None = None) -> Audact:
|
| 23 |
"""A local folder or a Hugging Face repo id. Needs NeMo for the audio encoder's architecture
|
| 24 |
(pip install "nemo_toolkit[asr]"); its base weights download once, then ours replace them."""
|
| 25 |
import sentencepiece as spm
|
{voice_tool_call → audact}/decode.py
RENAMED
|
File without changes
|
{voice_tool_call → audact}/needle.py
RENAMED
|
File without changes
|
{voice_tool_call → audact}/voice_model.py
RENAMED
|
File without changes
|
inference.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
import json
|
| 3 |
import sys
|
| 4 |
|
| 5 |
-
from
|
| 6 |
|
| 7 |
-
caller =
|
| 8 |
print(json.dumps(caller(sys.argv[1], json.load(open(sys.argv[2])))))
|
|
|
|
| 2 |
import json
|
| 3 |
import sys
|
| 4 |
|
| 5 |
+
from audact import Audact
|
| 6 |
|
| 7 |
+
caller = Audact.from_pretrained(".")
|
| 8 |
print(json.dumps(caller(sys.argv[1], json.load(open(sys.argv[2])))))
|
voice_tool_call/__init__.py
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
from .caller import VoiceToolCaller
|
| 2 |
-
|
| 3 |
-
__all__ = ["VoiceToolCaller"]
|
|
|
|
|
|
|
|
|
|
|
|