skroed commited on
Commit
71c2800
1 Parent(s): e6082f5

Add: Code example in README

Browse files
Files changed (1) hide show
  1. README.md +10 -1
README.md CHANGED
@@ -26,8 +26,17 @@ inference: true
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
 
33
  Bark is a transformer-based text-to-audio model created by [Suno](https://www.suno.ai).
 
26
  ---
27
 
28
  # Changes to suno/bark
29
+ This duplicated repo allows to pass a voice preset besides the text input when using and 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
  # Bark
41
 
42
  Bark is a transformer-based text-to-audio model created by [Suno](https://www.suno.ai).