minato56 commited on
Commit
76929d8
·
verified ·
1 Parent(s): 08bce12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -140,18 +140,12 @@ with gr.Blocks(title="Pixel AI — Friendly Coding Teacher") as demo:
140
  dev_button = gr.Button("Developer Mode Edit", visible=False)
141
  hidden_input = gr.Textbox(value="", visible=False)
142
 
 
143
  def activate_dev_button():
144
  return "__activate_dev_mode__"
145
 
146
- # نربط ظهور الزر مع حالة show_dev_button
147
- def check_show_button():
148
- return show_dev_button
149
-
150
  dev_button.click(fn=activate_dev_button, inputs=[], outputs=hidden_input)
151
  hidden_input.submit(fn=lambda x: x, inputs=[hidden_input], outputs=[chatbot])
152
 
153
- # تحديث ظهور الزر تلقائيًا
154
- demo.load(fn=check_show_button, inputs=[], outputs=[dev_button], every=0.5)
155
-
156
  if __name__ == "__main__":
157
  demo.launch()
 
140
  dev_button = gr.Button("Developer Mode Edit", visible=False)
141
  hidden_input = gr.Textbox(value="", visible=False)
142
 
143
+ # عند الضغط على الزر، نرسل رسالة لتفعيل تعديل الكود
144
  def activate_dev_button():
145
  return "__activate_dev_mode__"
146
 
 
 
 
 
147
  dev_button.click(fn=activate_dev_button, inputs=[], outputs=hidden_input)
148
  hidden_input.submit(fn=lambda x: x, inputs=[hidden_input], outputs=[chatbot])
149
 
 
 
 
150
  if __name__ == "__main__":
151
  demo.launch()