This commit is contained in:
2026-02-24 13:49:14 +01:00
parent ad031dee70
commit c6a6f3b22d
3 changed files with 43 additions and 1 deletions

View File

@ -1 +1,24 @@
test
# Utilisation d'une image légère avec support GPU
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
# Configuration environnement
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
# Installation des dépendances système (Audio + Python)
RUN apt-get update && apt-get install -y \
python3.11 python3-pip ffmpeg libsndfile1 git \
&& rm -rf /var/lib/apt/lists/*
# Installation des bibliothèques IA de base
RUN pip3 install --no-cache-dir \
torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 \
fastapi uvicorn gradio
# Copie du code serveur
COPY server.py .
# Exposition du port pour la communication interne
EXPOSE 7860
CMD ["python3.11", "server.py"]

View File

@ -0,0 +1,19 @@
import gradio as gr
import time
def generate_music(prompt, duration):
print(f"🎵 Génération demandée : {prompt} pour {duration} secondes")
# Simule un temps de calcul
time.sleep(2)
return "Dummy audio generated !"
# Interface pour Open WebUI
demo = gr.Interface(
fn=generate_music,
inputs=["text", "number"],
outputs="text",
title="ACE-Step Audio API"
)
if __name__ == "__main__":
demo.launch(server_name="0.0.0.0", server_port=7860)