sohfossted commited on
Commit
c321787
·
verified ·
1 Parent(s): f814a63

Upload app.py

Browse files

new element app

Files changed (1) hide show
  1. app.py +16 -20
app.py CHANGED
@@ -34,25 +34,6 @@ with gr.Blocks() as auth_demo:
34
 
35
  message_sortie = gr.Textbox(label="Statut", interactive=False)
36
 
37
- # Cacher l'application principale initialement
38
- with gr.Column(visible=False) as app_principale:
39
- # ICI VOUS COPIEZ TOUTE VOTRE APPLICATION EXISTANTE
40
- gr.Markdown("# 🧠 Votre Application IA")
41
- # ... [le reste de votre code actuel] ...
42
-
43
- def gerer_acces(code):
44
- est_valide, message = verifier_code(code)
45
- return message, gr.update(visible=est_valide)
46
-
47
- verifier_btn.click(
48
- fn=gerer_acces,
49
- inputs=code_input,
50
- outputs=[message_sortie, app_principale]
51
- )
52
-
53
- ##if __name__ == "__main__":
54
- ## auth_demo.launch()
55
-
56
  # Configuration logging
57
  logging.basicConfig(level=logging.INFO)
58
  logger = logging.getLogger(__name__)
@@ -289,4 +270,19 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Générateur de Présentation IA",
289
  )
290
 
291
  if __name__ == "__main__":
292
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  message_sortie = gr.Textbox(label="Statut", interactive=False)
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  # Configuration logging
38
  logging.basicConfig(level=logging.INFO)
39
  logger = logging.getLogger(__name__)
 
270
  )
271
 
272
  if __name__ == "__main__":
273
+ demo.launch(server_name="0.0.0.0", server_port=7860)
274
+ # Cacher l'application principale initialement
275
+ with gr.Column(visible=False) as app_principale:
276
+ def gerer_acces(code):
277
+ est_valide, message = verifier_code(code)
278
+ return message, gr.update(visible=est_valide)
279
+
280
+ verifier_btn.click(
281
+ fn=gerer_acces,
282
+ inputs=code_input,
283
+ outputs=[message_sortie, app_principale]
284
+ )
285
+
286
+ if __name__ == "__main__":
287
+ auth_demo.launch()
288
+