ACE-Step Custom commited on
Commit
d6ad90b
·
1 Parent(s): 9259263

Add /info endpoint override and pin Gradio version

Browse files
Files changed (2) hide show
  1. app.py +12 -0
  2. requirements.txt +1 -1
app.py CHANGED
@@ -657,6 +657,18 @@ if __name__ == "__main__":
657
  try:
658
  # Create and launch app
659
  app = create_ui()
 
 
 
 
 
 
 
 
 
 
 
 
660
  app.launch(
661
  server_name="0.0.0.0",
662
  server_port=7860,
 
657
  try:
658
  # Create and launch app
659
  app = create_ui()
660
+
661
+ # Override /info endpoint to prevent JSON schema errors
662
+ from fastapi.responses import JSONResponse
663
+
664
+ @app.fastapi_app.get("/info")
665
+ async def custom_api_info():
666
+ """Custom API info endpoint with error handling"""
667
+ return JSONResponse(content={
668
+ "error": "API schema generation disabled",
669
+ "message": "Use the Gradio UI for direct interaction"
670
+ })
671
+
672
  app.launch(
673
  server_name="0.0.0.0",
674
  server_port=7860,
requirements.txt CHANGED
@@ -1,7 +1,7 @@
1
  # Core Dependencies
2
  torch>=2.0.0
3
  torchaudio>=2.0.0
4
- gradio>=5.9.1
5
  transformers>=4.35.0
6
  diffusers>=0.25.0
7
  accelerate>=0.25.0
 
1
  # Core Dependencies
2
  torch>=2.0.0
3
  torchaudio>=2.0.0
4
+ gradio==5.9.1
5
  transformers>=4.35.0
6
  diffusers>=0.25.0
7
  accelerate>=0.25.0