Synced repo using 'sync_with_huggingface' Github Action
Browse files- config.yaml +1 -1
- src/app/app.py +5 -10
- 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 |
-
|
| 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 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 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 |
-
|
| 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 |
-
|
| 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 |
)
|