Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate replicate.com WhisperX #224

Open
maboa opened this issue May 8, 2024 · 1 comment
Open

Integrate replicate.com WhisperX #224

maboa opened this issue May 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@maboa
Copy link
Member

maboa commented May 8, 2024

// Define the API token and endpoint
const replicateAPIToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxx'; // You should secure this token properly in production
const url = 'https://api.replicate.com/v1/predictions';

// Define the data payload for the POST request
const data = {
  version: "4a60104c44dd709fc08a03dfeca6c6906257633dd03fd58663ec896a4eeba30e",
  input: {
    audio: "https://replicate.delivery/pbxt/IfYtYMI5B23lFkUoI7zDtehuLw2NzKCoJpmJQvSVGD5l3gfY/vocals.mp3",
    model: "large-v1",
    initial_prompt: "Karstadtdetektiv",
    suppress_tokens: -1,
    word_timestamps: true,
    logprob_threshold: -1,
    append_punctuations: "\"'.。,,!!??::”)]}、",
    no_speech_threshold: 0.6,
    prepend_punctuations: "'“¿([{-",
    condition_on_previous_text: true,
    compression_ratio_threshold: 2,
    temperature_increment_on_fallback: 0.2
  }
};

// Use fetch API to send the POST request
fetch(url, {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${replicateAPIToken}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log('Success:', data))
.catch((error) => console.error('Error:', error));
@thebigboss9018
Copy link

Hello! firstly, great project! secondly, anyway we could use our local machine whisper instead of relaying in an api?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants