Cheeky Sparrow
commited on
Commit
·
8172885
1
Parent(s):
5a6ef06
update handler
Browse files- handler.py +4 -4
handler.py
CHANGED
|
@@ -24,14 +24,14 @@ class EndpointHandler():
|
|
| 24 |
|
| 25 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 26 |
"""
|
| 27 |
-
Process audio
|
| 28 |
|
| 29 |
Parameters
|
| 30 |
----------
|
| 31 |
data : Dict[str, Any]
|
| 32 |
Dictionary containing:
|
| 33 |
-
-
|
| 34 |
-
Audio data as
|
| 35 |
- query : str
|
| 36 |
Question to ask about the audio
|
| 37 |
- sample_rate : int, optional
|
|
@@ -44,7 +44,7 @@ class EndpointHandler():
|
|
| 44 |
or error dictionary with 'error' key
|
| 45 |
"""
|
| 46 |
|
| 47 |
-
audio = data.get("
|
| 48 |
query = data.get("query", "")
|
| 49 |
sample_rate = data.get("sample_rate", 16000)
|
| 50 |
|
|
|
|
| 24 |
|
| 25 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 26 |
"""
|
| 27 |
+
Process audio list of floats with NatureLM-audio model.
|
| 28 |
|
| 29 |
Parameters
|
| 30 |
----------
|
| 31 |
data : Dict[str, Any]
|
| 32 |
Dictionary containing:
|
| 33 |
+
- inputs : list[float]
|
| 34 |
+
Audio data as list of floats
|
| 35 |
- query : str
|
| 36 |
Question to ask about the audio
|
| 37 |
- sample_rate : int, optional
|
|
|
|
| 44 |
or error dictionary with 'error' key
|
| 45 |
"""
|
| 46 |
|
| 47 |
+
audio = data.get("inputs")
|
| 48 |
query = data.get("query", "")
|
| 49 |
sample_rate = data.get("sample_rate", 16000)
|
| 50 |
|