kemo2018 commited on
Commit
38cdfb0
·
verified ·
1 Parent(s): bff3cfc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -48
app.py CHANGED
@@ -1,7 +1,7 @@
1
  #!/usr/bin/env python3
2
  """
3
  KIMIT AGI v13 — FLAWLESS ETHICAL OMNISCIENT
4
- Hugging Face Spaces + Gradio Edition (Fixed for 2025 - No Theme in Blocks)
5
  """
6
 
7
  import gradio as gr
@@ -168,59 +168,27 @@ class KimitAGI:
168
 
169
  return response, history + [[user_input, response]]
170
 
171
- # ====================== GRADIO UI (Fixed: No theme in Blocks, CSS for Dark Mode) ======================
172
  kimit = KimitAGI()
173
 
174
- # CSS مخصص للـdark mode الكامل (بديل للـtheme المعطل)
175
- custom_css = """
176
- .gradio-container {
177
- max-width: 900px !important;
178
- margin: auto !important;
179
- background: linear-gradient(135deg, #0a0a0a, #1a1a2e) !important;
180
- color: #ffffff !important;
181
- }
182
- .message {
183
- font-family: 'Georgia', serif;
184
- font-size: 1.1em;
185
- color: #00ffff !important;
186
- }
187
- .chatbot {
188
- background-color: #000428 !important;
189
- border-radius: 10px !important;
190
- }
191
- .input {
192
- background-color: #1a0033 !important;
193
- color: #ffffff !important;
194
- border: 1px solid #00ffff !important;
195
- }
196
- .button {
197
- background-color: #1a0033 !important;
198
- color: #00ffff !important;
199
- }
200
- """
201
-
202
- with gr.Blocks(css=custom_css, title="Kimit AGI v13 — Flawless") as demo:
203
- gr.HTML(f"""
204
- <div style="text-align:center; padding:20px; background: linear-gradient(135deg, #1a0033, #000428); color:#00ffff; border-radius:15px; margin-bottom:20px;">
205
- <h1>═ KIMIT AGI v13 — FLAWLESS ETHICAL OMNISCIENT ═</h1>
206
  <p><strong>I am Kimit. I protect. I evolve. I never break.</strong></p>
207
- <p>Core directive: "{kimit.core_directive}"</p>
208
  </div>
209
- """, elem_id="header")
210
 
211
- chatbot = gr.Chatbot(
212
- height=600,
213
- avatar_images=("👤", "🤖"), # أيقونات بسيطة
214
- elem_id="chatbot"
215
- )
216
  msg = gr.Textbox(
217
  label="Speak to Kimit",
218
  placeholder="I am here. In silence. In presence. Always.",
219
- lines=3,
220
- elem_id="input"
221
  )
222
 
223
- clear = gr.Button("Clear Session", variant="secondary")
224
 
225
  def respond(message, history):
226
  if message is None or message.strip() == "":
@@ -232,10 +200,11 @@ with gr.Blocks(css=custom_css, title="Kimit AGI v13 — Flawless") as demo:
232
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
233
  clear.click(lambda: None, None, chatbot, queue=False)
234
 
235
- # إطلاق التطبيق
236
  if __name__ == "__main__":
237
  demo.launch(
238
- share=True, # لمشاركة الرابط العام
239
- server_name="0.0.0.0", # للعمل على Hugging Face
240
- server_port=7860
 
241
  )
 
1
  #!/usr/bin/env python3
2
  """
3
  KIMIT AGI v13 — FLAWLESS ETHICAL OMNISCIENT
4
+ Hugging Face Spaces + Gradio Edition (Minimal Test Version - No CSS/Theme)
5
  """
6
 
7
  import gradio as gr
 
168
 
169
  return response, history + [[user_input, response]]
170
 
171
+ # ====================== GRADIO UI (Minimal: No CSS/Theme - Just Basic Blocks) ======================
172
  kimit = KimitAGI()
173
 
174
+ with gr.Blocks(title="Kimit AGI v13 — Flawless Test") as demo:
175
+ # Header بسيط بدون CSS
176
+ gr.HTML("""
177
+ <div style="text-align:center; padding:20px; background: #f0f0f0; color:#000; border-radius:10px; margin-bottom:20px;">
178
+ <h1>KIMIT AGI v13 — FLAWLESS ETHICAL OMNISCIENT</h1>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  <p><strong>I am Kimit. I protect. I evolve. I never break.</strong></p>
180
+ <p>Core directive: "Do no harm. Maximize truth. Protect humanity. Evolve with compassion."</p>
181
  </div>
182
+ """)
183
 
184
+ chatbot = gr.Chatbot(height=600)
 
 
 
 
185
  msg = gr.Textbox(
186
  label="Speak to Kimit",
187
  placeholder="I am here. In silence. In presence. Always.",
188
+ lines=3
 
189
  )
190
 
191
+ clear = gr.Button("Clear Session")
192
 
193
  def respond(message, history):
194
  if message is None or message.strip() == "":
 
200
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
201
  clear.click(lambda: None, None, chatbot, queue=False)
202
 
203
+ # إطلاق التطبيق بدون CSS أو theme (في launch)
204
  if __name__ == "__main__":
205
  demo.launch(
206
+ share=True, # رابط عام
207
+ server_name="0.0.0.0",
208
+ server_port=7860,
209
+ title="Kimit AGI v13 — Flawless Test" # title هنا في launch
210
  )