Spaces:
Running
Running
jhj0517
commited on
Commit
·
0d39c53
1
Parent(s):
6bd9d73
add `api_open`
Browse files- app.py +1 -0
- user-start-webui.bat +5 -3
app.py
CHANGED
|
@@ -266,6 +266,7 @@ parser.add_argument('--username', type=str, default=None, help='Gradio authentic
|
|
| 266 |
parser.add_argument('--password', type=str, default=None, help='Gradio authentication password')
|
| 267 |
parser.add_argument('--theme', type=str, default=None, help='Gradio Blocks theme')
|
| 268 |
parser.add_argument('--colab', type=bool, default=False, nargs='?', const=True, help='Is colab user or not')
|
|
|
|
| 269 |
_args = parser.parse_args()
|
| 270 |
|
| 271 |
if __name__ == "__main__":
|
|
|
|
| 266 |
parser.add_argument('--password', type=str, default=None, help='Gradio authentication password')
|
| 267 |
parser.add_argument('--theme', type=str, default=None, help='Gradio Blocks theme')
|
| 268 |
parser.add_argument('--colab', type=bool, default=False, nargs='?', const=True, help='Is colab user or not')
|
| 269 |
+
parser.add_argument('--api_open', type=bool, default=False, nargs='?', const=True, help='enable api or not')
|
| 270 |
_args = parser.parse_args()
|
| 271 |
|
| 272 |
if __name__ == "__main__":
|
user-start-webui.bat
CHANGED
|
@@ -9,8 +9,7 @@ set PASSWORD=
|
|
| 9 |
set SHARE=
|
| 10 |
set THEME=
|
| 11 |
set DISABLE_FASTER_WHISPER=
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
|
| 16 |
:: Set args accordingly
|
|
@@ -35,7 +34,10 @@ if not "%THEME%"=="" (
|
|
| 35 |
if /I "%DISABLE_FASTER_WHISPER%"=="true" (
|
| 36 |
set DISABLE_FASTER_WHISPER_ARG=--disable_faster_whisper
|
| 37 |
)
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
:: Call the original .bat script with optional arguments
|
| 40 |
-
start-webui.bat %SERVER_NAME_ARG% %SERVER_PORT_ARG% %USERNAME_ARG% %PASSWORD_ARG% %SHARE_ARG% %THEME_ARG% %DISABLE_FASTER_WHISPER_ARG%
|
| 41 |
pause
|
|
|
|
| 9 |
set SHARE=
|
| 10 |
set THEME=
|
| 11 |
set DISABLE_FASTER_WHISPER=
|
| 12 |
+
set API_OPEN=
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
:: Set args accordingly
|
|
|
|
| 34 |
if /I "%DISABLE_FASTER_WHISPER%"=="true" (
|
| 35 |
set DISABLE_FASTER_WHISPER_ARG=--disable_faster_whisper
|
| 36 |
)
|
| 37 |
+
if /I "%API_OPEN%"=="true" (
|
| 38 |
+
set API_OPEN=--api_open
|
| 39 |
+
)
|
| 40 |
|
| 41 |
:: Call the original .bat script with optional arguments
|
| 42 |
+
start-webui.bat %SERVER_NAME_ARG% %SERVER_PORT_ARG% %USERNAME_ARG% %PASSWORD_ARG% %SHARE_ARG% %THEME_ARG% %DISABLE_FASTER_WHISPER_ARG% %API_OPEN%
|
| 43 |
pause
|