Easy demo，but thread started， then loop in（self.started ）
import gradio as grdef greet(name):return "Hello " + name + “!”demo = gr.Interface(fn=greet, inputs=“text”, outputs=“text”)ifname== “main”:demo.launch()class Server(uvicorn.Server):def install_signal_handlers(self):passdef run_in_thread(self):
    self.thread = threading.Thread(target=self.run, daemon=True)
    self.thread.start()
    while not self.started:
        *time.sleep(1e-3)*

def close(self):
    self.should_exit = True
    self.thread.join()tracing  it find  loop  sleep  ?stack     run_in_thread, networking.py:39start_server, networking.py:163launch, blocks.py:1703, app.py:11
2023-04-15T05:54:41Z
F:\Anaconda3\envs\chatglm\python.exe D:\chatglm-6b-int4\app.pyTraceback (most recent call last):File “D:\chatglm-6b-int4\app.py”, line 11, indemo.launch()File “F:\Anaconda3\envs\chatglm\Lib\site-packages\gradio\blocks.py”, line 1703, in launchserver_name, server_port, local_url, app, server = networking.start_server(^^^^^^^^^^^^^^^^^^^^^^^^File “F:\Anaconda3\envs\chatglm\Lib\site-packages\gradio\networking.py”, line 163, in start_serverserver.run_in_thread()File “F:\Anaconda3\envs\chatglm\Lib\site-packages\gradio\networking.py”, line 39, in run_in_threadtime.sleep(1e-3)KeyboardInterrupt
2023-04-15T05:56:14Z
(chatglm) D:\chatglm-6b-int4>pip listPackage              Versionaiofiles             23.1.0aiohttp              3.8.4aiosignal            1.3.1altair               4.2.2anyio                3.5.0appdirs              1.4.4argon2-cffi          21.3.0argon2-cffi-bindings 21.2.0asttokens            2.0.5async-timeout        4.0.2attrs                22.1.0Babel                2.11.0backcall             0.2.0beautifulsoup4       4.12.2bleach               4.1.0brotlipy             0.7.0certifi              2022.12.7cffi                 1.15.1chardet              5.1.0charset-normalizer   2.0.4click                7.1.2colorama             0.4.6comm                 0.1.2contourpy            1.0.7cpm-kernels          1.0.11cryptography         39.0.1cycler               0.11.0daal4py              2023.0.2debugpy              1.5.1decorator            5.1.1defusedxml           0.7.1docopt               0.6.2entrypoints          0.4executing            0.8.3fastapi              0.95.0fastjsonschema       2.16.2ffmpy                0.3.0filelock             3.11.0flit_core            3.8.0fonttools            4.39.3frozenlist           1.3.3fsspec               2023.4.0gradio               3.27.0gradio_client        0.1.3h11                  0.14.0httpcore             0.17.0httpx                0.24.0huggingface-hub      0.13.4idna                 3.4ipykernel            6.19.2ipython              8.12.0ipython-genutils     0.2.0ipywidgets           8.0.4jedi                 0.18.1Jinja2               3.1.2joblib               1.1.1json5                0.9.6jsonschema           4.17.3jupyter              1.0.0jupyter_client       8.1.0jupyter-console      6.6.3jupyter_core         5.3.0jupyter-server       1.23.4jupyterlab           3.5.3jupyterlab-pygments  0.1.2jupyterlab_server    2.22.0jupyterlab-widgets   3.0.5kiwisolver           1.4.4linkify-it-py        2.0.0lxml                 4.9.2markdown-it-py       2.2.0MarkupSafe           2.1.1matplotlib           3.7.1matplotlib-inline    0.1.6mdit-py-plugins      0.3.3mdurl                0.1.2mistune              0.8.4mkl-fft              1.3.1mkl-random           1.2.2mkl-service          2.4.0mpmath               1.3.0multidict            6.0.4nbclassic            0.5.4nbclient             0.5.13nbconvert            6.5.4nbformat             5.7.0nest-asyncio         1.5.6networkx             3.1notebook             6.5.3notebook_shim        0.2.2numpy                1.23.5orjson               3.8.10packaging            23.0pandas               2.0.0pandocfilters        1.5.0parso                0.8.3pickleshare          0.7.5Pillow               9.5.0pip                  23.0.1pipreqs              0.4.12platformdirs         2.5.2ply                  3.11pooch                1.4.0prometheus-client    0.14.1prompt-toolkit       3.0.36protobuf             4.22.1psutil               5.9.0pure-eval            0.2.2pycparser            2.21pydantic             1.10.7pydub                0.25.1Pygments             2.11.2pyOpenSSL            23.0.0pyparsing            3.0.9PyQt5                5.15.7PyQt5-sip            12.11.0pyrsistent           0.18.0PySocks              1.7.1python-dateutil      2.8.2python-multipart     0.0.6pytz                 2022.7pywin32              305.1pywinpty             2.0.10PyYAML               6.0pyzmq                23.2.0qtconsole            5.4.2QtPy                 2.2.0radio                0.1.3regex                2023.3.23requests             2.28.1scikit-learn         1.2.2scikit-learn-intelex 20230308.183507scipy                1.10.1semantic-version     2.10.0Send2Trash           1.8.0setuptools           65.6.3sip                  6.6.2six                  1.16.0sniffio              1.2.0soupsieve            2.4stack-data           0.2.0starlette            0.26.1sympy                1.11.1terminado            0.17.1threadpoolctl        2.2.0tinycss2             1.2.1tokenizers           0.13.3toml                 0.10.2tomli                2.0.1toolz                0.12.0torch                2.0.0+cu118torchaudio           2.0.0+cu118torchvision          0.15.0+cu118tornado              6.2tqdm                 4.65.0traitlets            5.7.1transformers         4.27.1typing_extensions    4.4.0tzdata               2023.3uc-micro-py          1.0.1urllib3              1.26.15uvicorn              0.21.1wcwidth              0.2.5webencodings         0.5.1websocket-client     0.58.0websockets           11.0.1wheel                0.38.4widgetsnbextension   4.0.5win-inet-pton        1.1.0wincertstore         0.2yarg                 0.1.9yarl                 1.8.2
2023-04-24T14:40:23Z
Hi@cndavy! Thanks for posting but it’s unclear what the issue/question about gradio is here. Can you please elaborate?