-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HTTP API for v3 #48
Conversation
6bc7175
to
1fddad0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, looks ok to me. DId the clients request a HTTP API ?
@@ -88,3 +89,12 @@ def split_text( | |||
if text: | |||
output.append(text.strip()) | |||
return output | |||
|
|||
def prepare_text(text: str | List[str], remove_ssml_tags: bool = True) -> List[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have some preprocessing copy-pasted here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm? It was previously copy-pasted but now lives only here
@@ -43,20 +45,96 @@ | |||
] | |||
|
|||
|
|||
class HTTPFormat(Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we support "RAW" where we don't encode ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAL API does not support RAW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote to them to add it. I will make sure they do or I will do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, will add
start_time = time.time() | ||
buffer = np.empty(buff_size, np.float16) | ||
audio = None | ||
async def async_save_audio(data: AsyncGenerator[bytes, None] | AsyncIterable[bytes]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you simplified the demo by just saving the audio and not dealing with the more complex -> playing of it, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was having a lot of dependency version issues with simpleaudio. Not the first time I have seen this. Think it is easier to just save it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
57d74d2
to
e267fc7
Compare
It is necessary because we do not use gRPC for FAL |
e267fc7
to
cd98201
Compare
cd98201
to
4cd0ff7
Compare
One issue: I think the first chunk returned from Chirpy/HTTP may contain audio as well as a header, whereas the first chunk returned from turbo-prop/gRPC is just the header (matters for logging TTFB). Will resolve this tonight or in the morning