-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding gunicorn config for model_server.py
- Loading branch information
1 parent
b9a0b82
commit 55bfc99
Showing
4 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Using LLMs in LIT on Google Cloud Platform | ||
|
||
Architectural Notes | ||
|
||
* The `LitApp` HTTP API assumes that inputs will be passed around as | ||
identifiers and the reconsituted on the LitApp server before being sent to | ||
the model. The `model_server.py` will not have direct access to the loaded Datasets, and thus the HTTP API assumes that the JSON data passed to its endpoints will be the complete, reconstituted examples from the `LitApp`. The `model_server.py` will send back predictions in full JSON format. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ============================================================================== | ||
"""gunicorn configuration for cloud-hosted demos.""" | ||
|
||
import os | ||
|
||
_PORT = os.getenv('PORT', '5432') | ||
|
||
bind = f'0.0.0.0:{_PORT}' | ||
timeout = 3600 | ||
threads = 8 | ||
worker_class = 'gthread' | ||
wsgi_app = f'lit_nlp.examples.gcp.model_server:get_wsgi_app()' |