File size: 602 Bytes
11f413e
 
 
 
 
 
4275b0f
 
 
300a419
4275b0f
 
300a419
4275b0f
 
300a419
4275b0f
 
 
 
 
300a419
4275b0f
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
license: apache-2.0
language:
- en
- hi
---
```
import transformers
import librosa

# load the model pipeline on gpu:0
pipe = transformers.pipeline(model='sarvam/shuka_v1', trust_remote_code=True, device=0)

# get a sample audio
# wget https://huggingface.co/sarvam/shuka_v1/resolve/main/hi-question.webm

audio, _ = librosa.load("./hi-question.webm", sr=16000)
turns = [
          {'role': 'system', 'content': 'Respond naturally and informatively.'},
          {'role': 'user', 'content': '<|audio|>'}
        ]

pipe({'audio': audio, 'turns': turns, 'sampling_rate': sr}, max_new_tokens=512)
```