From 88e69d9bfd7d17990585754071a569e7d168af5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=84=9C=EC=9A=B8=5F15=EB=B0=98=5F=EC=9D=B4=EB=AA=85?= =?UTF-8?q?=EA=B7=9C?= Date: Wed, 5 Apr 2023 08:58:09 +0900 Subject: [PATCH] =?UTF-8?q?update=20:=20merge=EB=A5=BC=20=EC=9C=84?= =?UTF-8?q?=ED=95=9C=20=EB=94=94=EB=A0=89=ED=86=A0=EB=A6=AC=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md => AI-Server/README.md | 0 app.py => AI-Server/app.py | 0 caption.py => AI-Server/caption.py | 0 .../diffusion}/diffusion_ControlNet.py | 0 gpt.py => AI-Server/gpt.py | 0 AI-Server/output.txt | 0 .../requirements.txt | Bin AI-Server/tmp.py | 53 ++++++++++++++++++ AI-Server/www.py | 5 ++ tmp.py | 3 - 10 files changed, 58 insertions(+), 3 deletions(-) rename README.md => AI-Server/README.md (100%) rename app.py => AI-Server/app.py (100%) rename caption.py => AI-Server/caption.py (100%) rename {diffusion => AI-Server/diffusion}/diffusion_ControlNet.py (100%) rename gpt.py => AI-Server/gpt.py (100%) create mode 100644 AI-Server/output.txt rename requirements.txt => AI-Server/requirements.txt (100%) create mode 100644 AI-Server/tmp.py create mode 100644 AI-Server/www.py delete mode 100644 tmp.py diff --git a/README.md b/AI-Server/README.md similarity index 100% rename from README.md rename to AI-Server/README.md diff --git a/app.py b/AI-Server/app.py similarity index 100% rename from app.py rename to AI-Server/app.py diff --git a/caption.py b/AI-Server/caption.py similarity index 100% rename from caption.py rename to AI-Server/caption.py diff --git a/diffusion/diffusion_ControlNet.py b/AI-Server/diffusion/diffusion_ControlNet.py similarity index 100% rename from diffusion/diffusion_ControlNet.py rename to AI-Server/diffusion/diffusion_ControlNet.py diff --git a/gpt.py b/AI-Server/gpt.py similarity index 100% rename from gpt.py rename to AI-Server/gpt.py diff --git a/AI-Server/output.txt b/AI-Server/output.txt new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/AI-Server/requirements.txt similarity index 100% rename from requirements.txt rename to AI-Server/requirements.txt diff --git a/AI-Server/tmp.py b/AI-Server/tmp.py new file mode 100644 index 0000000..cfcdef6 --- /dev/null +++ b/AI-Server/tmp.py @@ -0,0 +1,53 @@ +import subprocess +import time +import logging +from watchdog.observers import Observer +from watchdog.events import FileSystemEventHandler +# +# +# class ConsoleOutputEventHandler(FileSystemEventHandler): +# def __init__(self, expected_output): +# super().__init__() +# self.expected_output = expected_output +# self.prev_output = "" +# +# def on_modified(self, event): +# with open(event.src_path) as f: +# output = f.read() +# if self.expected_output in output and self.expected_output != self.prev_output: +# logging.info(f"{self.expected_output}가 출력됩니다") +# self.prev_output = self.expected_output +# +# +# def monitor_console_output(command, expected_output): +# logging.info(f"{command} 명령어를 실행합니다") +# with open("output.txt", "w") as f: +# subprocess.call(command, stdout=f, shell=True) +# +# logging.info(f"{expected_output} 출력을 모니터링합니다") +# event_handler = ConsoleOutputEventHandler(expected_output) +# observer = Observer() +# observer.schedule(event_handler, ".", recursive=False) +# observer.start() +# +# try: +# while True: +# time.sleep(1) +# except KeyboardInterrupt: +# observer.stop() +# observer.join() +# +# +# logging.basicConfig(level=logging.INFO) +# monitor_console_output("python www.py", "2") +import subprocess + +cmd = "python www.py" +process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, encoding='utf-8') +while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + if output: + print(output.strip()) + diff --git a/AI-Server/www.py b/AI-Server/www.py new file mode 100644 index 0000000..70e6fb8 --- /dev/null +++ b/AI-Server/www.py @@ -0,0 +1,5 @@ +from tqdm import tqdm + +# with open("output.txt", "w") as f: +for i in tqdm(range(100000000)): + pass \ No newline at end of file diff --git a/tmp.py b/tmp.py deleted file mode 100644 index cc1489f..0000000 --- a/tmp.py +++ /dev/null @@ -1,3 +0,0 @@ -import multiprocessing - -print(multiprocessing.cpu_count()) \ No newline at end of file