debut
This commit is contained in:
@ -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"]
|
||||||
19
services/audio-api/server.py
Normal file
19
services/audio-api/server.py
Normal 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)
|
||||||
Reference in New Issue
Block a user