Spaces:
Sleeping
Sleeping
Download tortoise/is_this_from_tortoise.py from heboya8/tortoise-tts: direct link, hf CLI and curl.
- Browser
- Download file 546 Bytes
-
https://huggingface.co/spaces/heboya8/tortoise-tts/resolve/main/tortoise/is_this_from_tortoise.py
- Command line
-
hf download hf://spaces/heboya8/tortoise-tts/tortoise/is_this_from_tortoise.py
-
curl -L -o is_this_from_tortoise.py https://huggingface.co/spaces/heboya8/tortoise-tts/resolve/main/tortoise/is_this_from_tortoise.py
546 Bytes
| import argparse | |
| from api import classify_audio_clip | |
| from tortoise.utils.audio import load_audio | |
| if __name__ == '__main__': | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--clip', type=str, help='Path to an audio clip to classify.', default="../examples/favorite_riding_hood.mp3") | |
| args = parser.parse_args() | |
| clip = load_audio(args.clip, 24000) | |
| clip = clip[:, :220000] | |
| prob = classify_audio_clip(clip) | |
| print(f"This classifier thinks there is a {prob*100}% chance that this clip was generated from Tortoise.") |