Onyxl commited on
Commit
a44e6d2
ยท
verified ยท
1 Parent(s): c66b1e0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +67 -10
README.md CHANGED
@@ -1,10 +1,67 @@
1
- ---
2
- title: README
3
- emoji: ๐ŸŒ
4
- colorFrom: purple
5
- colorTo: blue
6
- sdk: gradio
7
- pinned: false
8
- ---
9
-
10
- Edit this `README.md` markdown file to author your organization card.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # --- THE HARD-CODED BLUEPRINT FOR GEMMA 3 ---
4
+ SYSTEM_CONTEXT = "TeraBites UI: Top-left Profile, Top-right Gemma Support, Middle Chat, Bottom Prompt."
5
+
6
+ def gemma_3_local_service(query):
7
+ # Simulated Gemma 3 Intelligence based on the fed code
8
+ if "group" in query.lower():
9
+ return "Gemma 3: Main Group is the foundation. Create squads in Settings."
10
+ return "Gemma 3: Standing by. No external connections active. Space is Secure."
11
+
12
+ def handle_chat(msg, history):
13
+ # Pure local chat logic
14
+ return history + [[msg, "๐Ÿ“ก [LOCAL SQUAD] Message received. (Isolated Mode)"]]
15
+
16
+ with gr.Blocks(theme=gr.themes.Monochrome(), css=".chat-feed {height: 60vh !important;}") as demo:
17
+
18
+ # 1. THE HEADER (Identity & Support)
19
+ with gr.Row():
20
+ with gr.Column(scale=1, variant="panel"):
21
+ gr.Markdown("๐Ÿ‘ค **IDENTITY**")
22
+ profile_name = gr.Textbox(value="Loading...", interactive=True, show_label=False)
23
+ gr.Markdown("๐Ÿ† **RANK:** WARRIOR")
24
+
25
+ with gr.Column(scale=2):
26
+ gr.Markdown("<h1 style='text-align: center;'>๐Ÿ”๏ธ TERABITESโ„ข HQ</h1>")
27
+ gr.Markdown("<p style='text-align: center;'>STATUS: <b>OFFLINE / ISOLATED</b></p>")
28
+
29
+ with gr.Column(scale=1, variant="panel"):
30
+ gr.Markdown("๐ŸŽง **GEMMA 3 SERVICE**")
31
+ support_in = gr.Textbox(placeholder="Ask about the UI...", show_label=False)
32
+ support_out = gr.Markdown("*Ready*")
33
+
34
+ gr.Markdown("---")
35
+
36
+ # 2. THE BODY (Groups & Chat)
37
+ with gr.Row():
38
+ # Sidebar
39
+ with gr.Column(scale=1):
40
+ gr.Markdown("### ๐Ÿ‘ฅ SQUADS")
41
+ group_sel = gr.Radio(["๐ŸŒ MAIN (Public)", "๐Ÿ› ๏ธ SQUAD-ALPHA"], value="๐ŸŒ MAIN (Public)", label=None)
42
+
43
+ with gr.Accordion("โš™๏ธ SETTINGS", open=False):
44
+ gr.Button("Invite Link (Testing)")
45
+ gr.Button("Delete Squad (Disabled)")
46
+
47
+ # The Big Gap (Chat)
48
+ with gr.Column(scale=4):
49
+ chatbot = gr.Chatbot(label=None, show_label=False, elem_classes="chat-feed")
50
+
51
+ # 3. THE PROMPT (Bottom Center)
52
+ with gr.Row():
53
+ msg_in = gr.Textbox(placeholder="Type a message...", scale=9, show_label=False)
54
+ send_btn = gr.Button("SUI", scale=1, variant="primary")
55
+
56
+ # --- LOCAL CONNECTIONS ONLY ---
57
+ support_in.submit(gemma_3_local_service, support_in, support_out)
58
+ send_btn.click(handle_chat, [msg_in, chatbot], [chatbot])
59
+
60
+ # HF Auth Profile Sync (Display only)
61
+ def sync_identity(profile: gr.OAuthProfile | None):
62
+ if profile: return profile.name
63
+ return "Guest_Warrior"
64
+
65
+ demo.load(sync_identity, None, profile_name)
66
+
67
+ demo.launch()