Spaces:
Runtime error
Runtime error
Download app.py from ssooraj/ImgGenerator: direct link, hf CLI and curl.
- Browser
- Download file 619 Bytes
-
https://huggingface.co/spaces/ssooraj/ImgGenerator/resolve/main/app.py
- Command line
-
hf download hf://spaces/ssooraj/ImgGenerator/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ssooraj/ImgGenerator/resolve/main/app.py
619 Bytes
| from transformers import pipeline | |
| import scipy | |
| import gradio as gr | |
| synthesiser = pipeline("text-to-audio", "facebook/musicgen-small") | |
| def generate_music(Prompt): | |
| music = synthesiser(Prompt, forward_params={"do_sample": True, "max_new_tokens":100}) | |
| rate = music["sampling_rate"] | |
| mus = music["audio"][0].reshape(-1) | |
| return rate,mus | |
| inf = gr.Interface(generate_music,title = "Mashdemy Demo Music Generator App", description = """Type in the kind | |
| of music you prefer and click submit""", inputs =["text"], outputs=["audio"], examples = ["""lo-fi music with a soothing | |
| melody""", "pop music"]) | |
| inf.launch(share = True) | |