Run this model with HF Jobs
Run BasketTechologies/bark on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/BasketTechologies/bark. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/BasketTechologies/bark on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use BasketTechologies/bark with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BasketTechologies/bark with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="BasketTechologies/bark")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForTextToWaveform processor = AutoProcessor.from_pretrained("BasketTechologies/bark") model = AutoModelForTextToWaveform.from_pretrained("BasketTechologies/bark", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update handler.py
Browse files123456789107 unmodified lines181920212223from typing import Dict, List, Anyfrom transformers import pipelineclass EndpointHandler:def __init__(self, path=""):self.model = pipeline("GPT2ForSequenceClassification", "suno/bark")def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:"""7 unmodified linestext_prompt = data.pop("inputs", data)# run normal predictionspeech_array = self.model(text_prompt,forward_params={"do_sample": True})return speech_array123456789107 unmodified lines18192021222324252627from typing import Dict, List, Anyfrom bark import SAMPLE_RATE, generate_audio, preload_modelsclass EndpointHandler:def __init__(self, path=""):preload_models()def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:"""7 unmodified linestext_prompt = data.pop("inputs", data)# run normal predictiontext_prompt = """Hello, my name is Suno. And, uh — and I like pizza. [laughs]But I also have other interests such as playing tic tac toe."""audio_array = generate_audio(text_prompt)return audio_array
handler.py+8-4