Skip to content
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

Merged
merged 2 commits into from
Sep 5, 2024
Merged

Add HTTP API for v3 #48

merged 2 commits into from
Sep 5, 2024

Conversation

bryananderson
Copy link
Contributor

@bryananderson bryananderson commented Sep 5, 2024

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

YavorGIvanov
YavorGIvanov previously approved these changes Sep 5, 2024
Copy link

@YavorGIvanov YavorGIvanov left a 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]:

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 ?

Copy link
Contributor Author

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):

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 ?

Copy link
Contributor Author

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

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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]):

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 ?

Copy link
Contributor Author

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

@bryananderson
Copy link
Contributor Author

Generally, looks ok to me. DId the clients request a HTTP API ?

It is necessary because we do not use gRPC for FAL

@bryananderson bryananderson merged commit fe72841 into master Sep 5, 2024
9 checks passed
@bryananderson bryananderson deleted the v3-http branch September 5, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants