Instructions to use SPRINGLab/SPRING_F5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SPRINGLab/SPRING_F5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="SPRINGLab/SPRING_F5", trust_remote_code=True)# Load model directly from transformers import SPRING_F5 model = SPRING_F5.from_pretrained("SPRINGLab/SPRING_F5", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| #! /usr/bin/env python3 | |
| from argparse import ArgumentParser | |
| from string import Template | |
| def main(file_path, substitutions, in_place, participant_ids): | |
| with open(file_path) as f: | |
| pbtxt = Template(f.read()) | |
| sub_dict = {"max_queue_size": 0} | |
| sub_dict["participant_ids"] = participant_ids | |
| for sub in substitutions.split(","): | |
| key, value = sub.split(":") | |
| sub_dict[key] = value | |
| pbtxt = pbtxt.safe_substitute(sub_dict) | |
| if in_place: | |
| with open(file_path, "w") as f: | |
| f.write(pbtxt) | |
| else: | |
| print(pbtxt) | |
| if __name__ == "__main__": | |
| parser = ArgumentParser() | |
| parser.add_argument("file_path", help="path of the .pbtxt to modify") | |
| parser.add_argument( | |
| "substitutions", | |
| help="substitutions to perform, in the format variable_name_1:value_1,variable_name_2:value_2...", | |
| ) | |
| parser.add_argument("--in_place", "-i", action="store_true", help="do the operation in-place") | |
| parser.add_argument("--participant_ids", help="Participant IDs for the model", default="") | |
| args = parser.parse_args() | |
| main(**vars(args)) | |