Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] occur a reference error when using it with flask_socketio #3856

Open
xulsup opened this issue Aug 9, 2024 · 1 comment
Open

[Bug] occur a reference error when using it with flask_socketio #3856

xulsup opened this issue Aug 9, 2024 · 1 comment
Labels
bug Something isn't working wontfix This will not be worked on but feel free to help.

Comments

@xulsup
Copy link

xulsup commented Aug 9, 2024

Describe the bug

When I import TTS module to my app.py(see the reproduce code), It will occur a reference error. When I don't import the TTS module, it can work well. I just want to use the flask_socketio to build a service to convert text to speech.

To Reproduce

the minimal reproducible code

from flask import Flask
from flask_socketio import SocketIO
import logging
from TTS.api import TTS


def create_app():
    app = Flask(__name__)
    return app


app = create_app()
socketio = SocketIO(
    app,
    path="/socket.io",
    cors_allowed_origins="*",
    logger=True,
    engineio_logger=True,
)


if __name__ == "__main__":
    host = "0.0.0.0"
    port = 8172
    app.logger.info(f"server listen on http://{host}:{port}")
    socketio.run(app, host, port, debug=True)
  1. run this code
  2. you can see the error
image

requirements.txt

Flask==3.0.3
Requests==2.32.3
gevent==24.2.1
Flask-SocketIO==5.3.6
gevent-websocket==0.10.1
TTS==0.22.0

Expected behavior

No error. It can run successful.

Logs

No response

Environment

- 🐸TTS Version (e.g., 1.3.0): 0.22.0
- PyTorch Version (e.g., 1.8): 2.4.0
- Python version: 3.9.19
- OS (e.g., Linux): Mac OS 14.5
- CUDA/cuDNN version: 
- GPU models and configuration: 
- How you installed PyTorch (`conda`, `pip`, source): pip
- Any other relevant information:

the JSON by collect_env_info.py

{
    "CUDA": {
        "GPU": [],
        "available": false,
        "version": null
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "2.4.0",
        "TTS": "0.22.0",
        "numpy": "1.22.0"
    },
    "System": {
        "OS": "Darwin",
        "architecture": [
            "64bit",
            ""
        ],
        "processor": "arm",
        "python": "3.9.19",
        "version": "Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000"
    }
}

Additional context

No response

@xulsup xulsup added the bug Something isn't working label Aug 9, 2024
Copy link

stale bot commented Sep 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.

@stale stale bot added the wontfix This will not be worked on but feel free to help. label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on but feel free to help.
Projects
None yet
Development

No branches or pull requests

1 participant