diff --git a/model_server/scripts/run_server.py b/model_server/scripts/run_server.py index b278252bfb9c82a54ea69b491e4893d4471cf510..0ec3f824eb78a0697b5afc1d96bc13386e734688 100644 --- a/model_server/scripts/run_server.py +++ b/model_server/scripts/run_server.py @@ -27,14 +27,14 @@ def parse_args(): ) return parser.parse_args() -if __name__ == '__main__': +def main() -> None: args = parse_args() print('CLI args:\n' + str(args)) server_process = Process( target=uvicorn.run, - args=('model_server.api:app',), + args=('model_server.base.api:app',), kwargs={ 'app_dir': '.', 'host': args.host, @@ -66,3 +66,7 @@ if __name__ == '__main__': server_process.terminate() print('Finished') + + +if __name__ == '__main__': + main() diff --git a/readme.md b/readme.md index 44b83a464ec6e3754ad9d2fa11364057b36d0188..fa995de525ae68097af6e171f14d8d6b9cbb8593 100644 --- a/readme.md +++ b/readme.md @@ -6,17 +6,15 @@ model_server implement image analysis jobs for online use (e.g. in feedback micr 1. Install Git:<br>https://git-scm.com/download/win 2. Install Miniforge for environment management:<br>https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge-pypy3-Windows-x86_64.exe 3. Under the Start menu, open `Miniforge3 > Miniforge Prompt` -4. In the new terminal, run:<br> +4. In the new terminal, clone the model_server repository:<br> `cd %userprofile%`<br> `git clone https://almf-staff:KJmFvyPRbpzoVZDqfMzV@git.embl.de/rhodes/model_server.git` -5. Open the newly created project root: `cd model_server` -6. Create the environment: `mamba env create --file requirements.yml --name model_server_env` -7. Activate the environment: `mamba activate model_server_env` -8. Add the project source as a Python package: `pip install -e .` +5. Then clone the trec-adaptive-feedback repository, run:<br> + `git clone https://almf-staff:gldt-9szJvEjhupPvMjDv18EB@git.embl.de/almf/trec-adaptive-feedback.git` +6. Open the newly created model_server project root: `cd model_server` +7. Create the environment: `mamba env create --file requirements.yml --name model_server_env` +8. Activate the environment: `mamba activate model_server_env` +9. Add the project source as a Python package: `pip install -e .` # Start the server -Simply click "start_server command" in the model_server directory. This should open a terminal that reports server requests, as well as a browser with a status confirmation page. To stop the server, type "stop" in the terminal. -# Examples - - - \ No newline at end of file +Simply click "start_server command" in the trec-adapative-feedback directory. This should open a terminal that reports server requests, as well as a browser with a status confirmation page. To stop the server, type "stop" in the terminal. \ No newline at end of file