Spaces:
Runtime error
Runtime error
Download app.py from NLPark/llama-python-streamingllm: direct link, hf CLI and curl.
- Browser
- Download file 437 Bytes
-
https://huggingface.co/spaces/NLPark/llama-python-streamingllm/resolve/6b70385400c6f6daca187a6360b3b009250edc1f/app.py
- Command line
-
hf download hf://spaces/NLPark/llama-python-streamingllm@6b70385400c6f6daca187a6360b3b009250edc1f/app.py
-
curl -L -o app.py https://huggingface.co/spaces/NLPark/llama-python-streamingllm/resolve/6b70385400c6f6daca187a6360b3b009250edc1f/app.py
437 Bytes
| import subprocess | |
| from hf_api import restart_space | |
| try: | |
| # 启动另一个程序,并通过管道捕获其输出 | |
| process = subprocess.Popen(["python", "sub_app.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
| while True: | |
| output = process.stdout.readline() | |
| if output: | |
| print(output.decode("utf-8").strip()) | |
| if process.poll() is not None: | |
| break | |
| finally: | |
| restart_space() | |