Instructions to use Neptune9728/sound-insight-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Neptune9728/sound-insight-models with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://Neptune9728/sound-insight-models") - Notebooks
- Google Colab
- Kaggle
Download test_predict.py from Neptune9728/sound-insight-models: direct link, hf CLI and curl.
- Browser
- Download file 540 Bytes
-
https://huggingface.co/Neptune9728/sound-insight-models/resolve/main/test_predict.py
- Command line
-
hf download hf://Neptune9728/sound-insight-models/test_predict.py
-
curl -L -o test_predict.py https://huggingface.co/Neptune9728/sound-insight-models/resolve/main/test_predict.py
540 Bytes
| import argparse | |
| import requests | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--url', default='http://127.0.0.1:8000/predict') | |
| parser.add_argument('--model', choices=['cat', 'baby', 'dog'], required=True) | |
| parser.add_argument('--audio', required=True) | |
| args = parser.parse_args() | |
| with open(args.audio, 'rb') as f: | |
| response = requests.post( | |
| args.url, | |
| data={'model': args.model}, | |
| files={'audio': (args.audio, f, 'audio/wav')}, | |
| timeout=120, | |
| ) | |
| print(response.status_code) | |
| print(response.text) | |