Skip to content

Commit

Permalink
Replace gradio executable with script
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyao9184 committed Dec 25, 2024
1 parent 8e0f3b2 commit b89e463
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "debugpy: surya gradio mirror",
"name": "debugpy: gradio_run mirror",
"type": "debugpy",
"request": "launch",
"program": "${env:CONDA_PREFIX}/envs/surya/bin/gradio",
"program": "${workspaceFolder}/gradio/gradio_run.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"args": [
Expand All @@ -20,10 +20,10 @@
"justMyCode": false
},
{
"name": "debugpy: surya gradio offline",
"name": "debugpy: gradio_run offline",
"type": "debugpy",
"request": "launch",
"program": "${env:CONDA_PREFIX}/envs/surya/bin/gradio",
"program": "${workspaceFolder}/gradio/gradio_run.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"args": [
Expand Down
7 changes: 7 additions & 0 deletions gradio/gradio_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# NOTE: copy from gradio bin
import re
import sys
from gradio.cli import cli
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(cli())

0 comments on commit b89e463

Please sign in to comment.