Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1 |
#https://huggingface.co/spaces/MisterAI/GenDoc_05
|
2 |
#app.py_146
|
3 |
-
#Separation Du Code
|
4 |
#Correction Sortie Logs
|
5 |
|
|
|
6 |
import os
|
7 |
import gradio as gr
|
8 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
@@ -172,7 +173,7 @@ with gr.Blocks(theme=gr.themes.Glass()) as demo:
|
|
172 |
with gr.Column():
|
173 |
status_output = gr.Textbox(
|
174 |
label="Statut",
|
175 |
-
lines=
|
176 |
value=timer.get_status()
|
177 |
)
|
178 |
generated_content = gr.Textbox(
|
@@ -212,13 +213,16 @@ with gr.Blocks(theme=gr.themes.Glass()) as demo:
|
|
212 |
)
|
213 |
|
214 |
# Met à jour le statut toutes les 5 secondes
|
215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
|
217 |
if __name__ == "__main__":
|
218 |
demo.launch()
|
219 |
|
220 |
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
|
|
1 |
#https://huggingface.co/spaces/MisterAI/GenDoc_05
|
2 |
#app.py_146
|
3 |
+
#Separation Du Code
|
4 |
#Correction Sortie Logs
|
5 |
|
6 |
+
|
7 |
import os
|
8 |
import gradio as gr
|
9 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
173 |
with gr.Column():
|
174 |
status_output = gr.Textbox(
|
175 |
label="Statut",
|
176 |
+
lines=10,
|
177 |
value=timer.get_status()
|
178 |
)
|
179 |
generated_content = gr.Textbox(
|
|
|
213 |
)
|
214 |
|
215 |
# Met à jour le statut toutes les 5 secondes
|
216 |
+
import threading
|
217 |
+
def update_status_periodically():
|
218 |
+
while True:
|
219 |
+
time.sleep(5)
|
220 |
+
status_output.value = update_status()
|
221 |
+
status_output.change(status_output.value, status_output)
|
222 |
+
|
223 |
+
threading.Thread(target=update_status_periodically, daemon=True).start()
|
224 |
|
225 |
if __name__ == "__main__":
|
226 |
demo.launch()
|
227 |
|
228 |
|
|
|
|
|
|
|
|