alan5543 commited on
Commit
2505ad5
·
1 Parent(s): 8bece0a
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -97,9 +97,9 @@ async def run_dia_tts(prompt: str, space_id: str = "ysharma/Dia-1.6B") -> str:
97
  async def main():
98
  logger.info(f"Attempting to start GradioSpacesTools MCP server on http://{HOST_ADDRESS}:{HOST_PORT}")
99
  try:
100
- # CORRECT FIX: Use 'streamable-http' transport AND mcp.run_sse_async()
101
  # This function runs within an already existing asyncio loop (started by asyncio.run(main()))
102
- await mcp.run_sse_async(transport='streamable-http')
103
  except Exception as e:
104
  logger.exception(f"Failed to start MCP server: {e}")
105
  logger.info("GradioSpacesTools MCP server stopped.")
 
97
  async def main():
98
  logger.info(f"Attempting to start GradioSpacesTools MCP server on http://{HOST_ADDRESS}:{HOST_PORT}")
99
  try:
100
+ # CORRECT FIX: Use 'streamable-http' transport AND mcp.run_async()
101
  # This function runs within an already existing asyncio loop (started by asyncio.run(main()))
102
+ await mcp.run_async(transport='streamable-http')
103
  except Exception as e:
104
  logger.exception(f"Failed to start MCP server: {e}")
105
  logger.info("GradioSpacesTools MCP server stopped.")