litvinovmitch11 commited on
Commit
c822e50
·
verified ·
1 Parent(s): ec8c2a5

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Files changed (3) hide show
  1. config.yaml +1 -1
  2. src/app/app.py +5 -10
  3. src/app/config.py +2 -2
config.yaml CHANGED
@@ -3,6 +3,6 @@ vocab_path: "./pretrained/vocab.json"
3
  config_path: "./pretrained/config.json"
4
  max_seq_len: 300
5
  server:
6
- local: true
7
  host: "0.0.0.0"
8
  port: 7861
 
3
  config_path: "./pretrained/config.json"
4
  max_seq_len: 300
5
  server:
6
+ share: false
7
  host: "0.0.0.0"
8
  port: 7861
src/app/app.py CHANGED
@@ -92,13 +92,8 @@ class App:
92
  "Thw worst thing in the world!"]
93
  )
94
 
95
- if self.config.local:
96
- interface.launch(
97
- share=False,
98
- server_name=self.config.host,
99
- server_port=self.config.port
100
- )
101
- else:
102
- interface.launch(
103
- share=True
104
- )
 
92
  "Thw worst thing in the world!"]
93
  )
94
 
95
+ interface.launch(
96
+ share=self.config.share,
97
+ server_name=self.config.host,
98
+ server_port=self.config.port
99
+ )
 
 
 
 
 
src/app/config.py CHANGED
@@ -9,7 +9,7 @@ class AppConfig:
9
  vocab_path: str
10
  config_path: str
11
  max_seq_len: int = 300
12
- local: bool = True
13
  host: str = "0.0.0.0"
14
  port: int = 7861
15
 
@@ -33,7 +33,7 @@ class AppConfig:
33
  vocab_path=config_data['vocab_path'],
34
  config_path=config_data['config_path'],
35
  max_seq_len=int(config_data['max_seq_len']),
36
- local=config_data.get('server', {}).get('local', True),
37
  host=config_data.get('server', {}).get('host', "0.0.0.0"),
38
  port=config_data.get('server', {}).get('port', 7861)
39
  )
 
9
  vocab_path: str
10
  config_path: str
11
  max_seq_len: int = 300
12
+ share: bool = True
13
  host: str = "0.0.0.0"
14
  port: int = 7861
15
 
 
33
  vocab_path=config_data['vocab_path'],
34
  config_path=config_data['config_path'],
35
  max_seq_len=int(config_data['max_seq_len']),
36
+ share=config_data.get('server', {}).get('share', True),
37
  host=config_data.get('server', {}).get('host', "0.0.0.0"),
38
  port=config_data.get('server', {}).get('port', 7861)
39
  )