facebookresearch / audiocraft

Audiocraft is a library for audio processing and generation with deep learning. It features the state-of-the-art EnCodec audio compressor / tokenizer, along with MusicGen, a simple and controllable music generation LM with textual and melodic conditioning.
MIT License
21.05k stars 2.17k forks source link

How to download file using api #140

Open tristandevs opened 1 year ago

tristandevs commented 1 year ago

Hi there! I have a Discord bot that I created using discord.py. Lately, I've been working on adding a /music command that generates something. To achieve this, Im using a self hosted audiocraft library so I can use the api for my bot, it is using Gradio. Now, when my bot attempts to download the file after the api generates it, it doesn't work as expected. The issue seems to be related to the way I'm requesting the API download URL. I'm trying to request a download from: myapidomain.com/file=C:/Users/trist/AppData/Local/Temp/gradio/0aa6481d0 but it don't work because its an embedded video player and causes my code to download an empty file. Can anyone help me find a solution to this problem?

Woahai321 commented 1 year ago

Hello!

We have just released a rough proof of concept for audio craft + discord integration.

You can check out how we have integrated it here! - https://github.com/Woahai321/DiscoCraft