decula commited on
Commit ·
fd6b7ef
1
Parent(s): 5e6f72e
Add frpc
Browse files
app.py
CHANGED
|
@@ -135,6 +135,18 @@ Edward:''', 333, 1, 0.3, 0, 1],
|
|
| 135 |
]
|
| 136 |
|
| 137 |
##########################################################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
# Gradio blocks
|
| 140 |
with gr.Blocks(title=title) as demo:
|
|
|
|
| 135 |
]
|
| 136 |
|
| 137 |
##########################################################################
|
| 138 |
+
port=7860
|
| 139 |
+
use_frpc=True
|
| 140 |
+
frpconfigfile="7680.ini"
|
| 141 |
+
import subprocess
|
| 142 |
+
|
| 143 |
+
def install_Frpc(port, frpconfigfile, use_frpc):
|
| 144 |
+
if use_frpc:
|
| 145 |
+
subprocess.run(['chmod', '+x', '/kaggle/working/frpc/frpc'], check=True)
|
| 146 |
+
print(f'正在启动frp ,端口{port}')
|
| 147 |
+
subprocess.Popen(['/kaggle/working/frpc/frpc', '-c', frpconfigfile])
|
| 148 |
+
|
| 149 |
+
install_Frpc('7860',frpconfigfile,use_frpc)
|
| 150 |
|
| 151 |
# Gradio blocks
|
| 152 |
with gr.Blocks(title=title) as demo:
|