Salt commited on
Commit
ca688b4
·
1 Parent(s): 377ff8f

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +30 -1
server.py CHANGED
@@ -48,14 +48,43 @@ class SplitArgs(argparse.Action):
48
  setattr(
49
  namespace, self.dest, values.replace('"', "").replace("'", "").split(",")
50
  )
 
 
 
51
  parser = argparse.ArgumentParser(
52
  prog="TavernAI Extras", description="Web API for transformers models"
53
  )
 
 
 
 
 
 
 
 
 
 
54
  parser.add_argument("--summarization-model", help="Load a custom summarization model")
55
- parser.add_argument("--classification-model", help="Load a custom text classification model")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  args = parser.parse_args()
58
 
 
59
  summarization_model = (
60
  args.summarization_model
61
  if args.summarization_model
 
48
  setattr(
49
  namespace, self.dest, values.replace('"', "").replace("'", "").split(",")
50
  )
51
+
52
+
53
+ # Script arguments
54
  parser = argparse.ArgumentParser(
55
  prog="TavernAI Extras", description="Web API for transformers models"
56
  )
57
+ parser.add_argument(
58
+ "--port", type=int, help="Specify the port on which the application is hosted"
59
+ )
60
+ parser.add_argument(
61
+ "--listen", action="store_true", help="Host the app on the local network"
62
+ )
63
+ parser.add_argument(
64
+ "--share", action="store_true", help="Share the app on CloudFlare tunnel"
65
+ )
66
+ parser.add_argument("--cpu", action="store_true", help="Run the models on the CPU")
67
  parser.add_argument("--summarization-model", help="Load a custom summarization model")
68
+ parser.add_argument(
69
+ "--classification-model", help="Load a custom text classification model"
70
+ )
71
+ parser.add_argument("--captioning-model", help="Load a custom captioning model")
72
+ parser.add_argument(
73
+ "--keyphrase-model", help="Load a custom keyphrase extraction model"
74
+ )
75
+ parser.add_argument("--prompt-model", help="Load a custom prompt generation model")
76
+ parser.add_argument("--embedding-model", help="Load a custom text embedding model")
77
+
78
+ parser.add_argument(
79
+ "--enable-modules",
80
+ action=SplitArgs,
81
+ default=[],
82
+ help="Override a list of enabled modules",
83
+ )
84
 
85
  args = parser.parse_args()
86
 
87
+
88
  summarization_model = (
89
  args.summarization_model
90
  if args.summarization_model