Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
3 |
-
import threading
|
4 |
|
5 |
-
logs = [] #
|
6 |
|
7 |
def run_training():
|
8 |
global logs
|
@@ -17,13 +16,13 @@ def run_training():
|
|
17 |
|
18 |
for line in process.stdout:
|
19 |
logs.append(line)
|
20 |
-
yield "\n".join(logs[-50:]) # عرض آخر 50 سطر فقط
|
21 |
|
22 |
with gr.Blocks() as demo:
|
23 |
with gr.Row():
|
24 |
btn = gr.Button("🚀 Start Training")
|
25 |
-
output = gr.Textbox(label="Logs", lines=25)
|
26 |
|
27 |
btn.click(fn=run_training, outputs=output)
|
28 |
|
29 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
|
|
3 |
|
4 |
+
logs = [] # لتخزين اللوجات
|
5 |
|
6 |
def run_training():
|
7 |
global logs
|
|
|
16 |
|
17 |
for line in process.stdout:
|
18 |
logs.append(line)
|
19 |
+
yield "\n".join(logs[-50:]) # عرض آخر 50 سطر فقط في الواجهة
|
20 |
|
21 |
with gr.Blocks() as demo:
|
22 |
with gr.Row():
|
23 |
btn = gr.Button("🚀 Start Training")
|
24 |
+
output = gr.Textbox(label="Logs", lines=25, interactive=False)
|
25 |
|
26 |
btn.click(fn=run_training, outputs=output)
|
27 |
|
28 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|