Skip to content

Commit

Permalink
[HF][streaming][3/n] Text2Speech (no streaming, but updating docs on …
Browse files Browse the repository at this point in the history
…completion params)

Ok this one is weird. Today, streaming is only ever supported on text outputs in Transformers library. See `BaseStreamer` in here: https://github.com/search?q=repo%3Ahuggingface%2Ftransformers%20BaseStreamer&type=code

In the future it may support other formats, but not yet. For example, OpenAI supports it: https://community.openai.com/t/streaming-from-text-to-speech-api/493784

Anyways, I basically here only did some updates to docs to clarify why completion params were null. Jonathan and I synced about this briefly ofline, but I forgot again so wanted to capture it here so no one forgets
  • Loading branch information
Rossdan Craig [email protected] committed Jan 10, 2024
1 parent 5888ac3 commit 617682e
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

# Step 1: define Helpers
def refine_pipeline_creation_params(model_settings: Dict[str, Any]) -> List[Dict[str, Any]]:
# There are from the transformers Github repo:
# https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L2534
supported_keys = {
"torch_dtype",
"force_download",
Expand Down Expand Up @@ -61,9 +63,11 @@ def refine_pipeline_creation_params(model_settings: Dict[str, Any]) -> List[Dict


def refine_completion_params(unfiltered_completion_params: Dict[str, Any]) -> Dict[str, Any]:
supported_keys = {
# ???
}
# Note: There seems to be no public API docs on what completion
# params are supported for text to speech:
# https://huggingface.co/docs/transformers/tasks/text-to-speech#inference
# The only one mentioned is `forward_params` which can contain `speaker_embeddings`
supported_keys = {}

completion_params: Dict[str, Any] = {}
for key in unfiltered_completion_params:
Expand Down

0 comments on commit 617682e

Please sign in to comment.