Views
No views yet
1git clone https://huggingface.co/marcosremar2/salmonn-inference
2cd salmonn-inference
3
4# Create virtual environment
5python -m venv venv
6source venv/bin/activate
7
8# Install dependencies
9pip install -r requirements.txt./install.shpython server.pyhttp://localhost:80001curl -X POST "http://localhost:8000/transcribe" \
2 -F "audio=@your_audio.wav"1curl -X POST "http://localhost:8000/chat" \
2 -F "audio=@your_audio.wav" \
3 -F "question=What is being said in this audio?"1from inference import SALMONNInference
2
3model = SALMONNInference()
4model.load()
5
6# Transcribe
7text = model.transcribe("audio.wav")
8
9# Ask questions
10answer = model.chat("audio.wav", "What language is being spoken?")
11
12# Describe audio
13description = model.describe("audio.wav")| Endpoint | Method | Description |
|---|---|---|
/ | GET | API info |
/health | GET | Health check |
/transcribe | POST | Transcribe audio to text |
/chat | POST | Ask questions about audio |
/describe | POST | Get audio description |
config.yaml to customize:1model:
2 device: "cuda:0" # GPU device
3
4server:
5 host: "0.0.0.0"
6 port: 8000
7
8generation:
9 max_new_tokens: 200
10 temperature: 1.0| Metric | Value |
|---|---|
| Model Load Time | ~20s |
| Audio Encode | ~250ms |
| Time to First Token | ~150ms |
| Tokens/second | ~18 |
| GPU Memory | ~16GB |
<unk> tokens).