-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathgws_gui_web.py
More file actions
25 lines (17 loc) · 819 Bytes
/
gws_gui_web.py
File metadata and controls
25 lines (17 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Gradio launcher."""
from __future__ import annotations
import argparse
import os
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
def _parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Run Google Workspace Assistant in Gradio.")
parser.add_argument("--host", default="0.0.0.0", help="Host interface for Gradio server.")
parser.add_argument("--port", type=int, default=int(os.environ.get("PORT", 7860)), help="Port for Gradio server.")
parser.add_argument("--share", action="store_true", help="Enable public Gradio share link.")
return parser.parse_args()
if __name__ == "__main__":
args = _parse_args()
from gws_assistant.gradio_app import main
main(host=args.host, port=args.port, share=args.share)