skroed commited on
Commit
925d62f
1 Parent(s): 40d197d

Add: Code example in README

Browse files
Files changed (1) hide show
  1. README.md +11 -1
README.md CHANGED
@@ -26,7 +26,17 @@ pipeline_tag: text-to-speech
26
  ---
27
 
28
  # Changes to suno/bark
29
- This duplicated repo allows to pass a voice preset besides the text input. See `handler.py` for details.
 
 
 
 
 
 
 
 
 
 
30
 
31
  # Bark
32
 
 
26
  ---
27
 
28
  # Changes to suno/bark
29
+ This duplicated repo allows to pass a voice preset besides the text input when using an inference client. See `handler.py` for details.
30
+ Example:
31
+ ```python
32
+ import numpy as np
33
+ from huggingface_hub import InferenceClient
34
+
35
+ client = InferenceClient(model="<my-inference-url>")
36
+ sentence = "hello my name is suno"
37
+ audio_raw = client.post(json={'inputs': sentence, 'voice_preset': "v2/en_speaker_0",})
38
+ audio = np.array(eval(audio_raw)[0]['generated_audio'][0],)
39
+ ```
40
 
41
  # Bark
42