Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
boli-bohan committed Nov 1, 2024
1 parent b7e7fb0 commit 0637b3b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions cartesia/voices.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def create(

return response.json()


def create_hifi_clone(
self,
name: str,
Expand All @@ -127,7 +126,18 @@ def create_hifi_clone(
language: str = "en",
base_voice_id: Optional[str] = None,
) -> VoiceMetadata:
"""Create a new voice by cloning from a file using the HiFi voice cloning model."""
"""Create a new voice by cloning from a file using the HiFi voice cloning model.
Args:
name: The name of the voice.
description: The description of the voice.
filepath: The path to the audio file.
language: The language of the audio file. Defaults to "en".
base_voice_id: The ID of the base voice. This should be a valid voice ID if specified.
Returns:
A dictionary containing the voice metadata.
"""
url = f"{self._http_url()}/voices/clone/hifi"
with open(filepath, "rb") as file:
files = {
Expand All @@ -146,7 +156,7 @@ def create_hifi_clone(
url,
headers=headers,
files=files, # Use files parameter for multipart/form-data
timeout=self.timeout
timeout=self.timeout,
)

if not response.is_success:
Expand Down

0 comments on commit 0637b3b

Please sign in to comment.