Skip to content

Commit

Permalink
Merge pull request #204 from romilbhardwaj/localui_update
Browse files Browse the repository at this point in the history
[UI] Add argparse for specifying port and host
  • Loading branch information
PromtEngineer committed Jul 9, 2023
2 parents 33392b7 + dc4021a commit cb06803
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion localGPTUI/localGPTUI.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
import os
import sys
import tempfile
Expand Down Expand Up @@ -55,4 +56,12 @@ def home_page():


if __name__ == "__main__":
app.run(debug=False, port=5111)
parser = argparse.ArgumentParser()
parser.add_argument("--port", type=int, default=5111,
help="Port to run the UI on. Defaults to 5111.")
parser.add_argument("--host", type=str, default="127.0.0.1",
help="Host to run the UI on. Defaults to 127.0.0.1. "
"Set to 0.0.0.0 to make the UI externally "
"accessible from other devices.")
args = parser.parse_args()
app.run(debug=False, host=args.host, port=args.port)

0 comments on commit cb06803

Please sign in to comment.