Spaces:
Runtime error
Runtime error
secret added
Browse files
app.py
CHANGED
|
@@ -2,12 +2,13 @@ import gradio as gr
|
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
#
|
| 6 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 7 |
|
| 8 |
-
#
|
| 9 |
client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct", token=HF_TOKEN)
|
| 10 |
|
|
|
|
| 11 |
def samaran_kernel_chat(message, history):
|
| 12 |
system_message = "You are T3Sam3, the Samaran Kernel. Provide deep, blue-tier logic. Be witty and technical."
|
| 13 |
|
|
@@ -28,7 +29,7 @@ def samaran_kernel_chat(message, history):
|
|
| 28 |
response += token
|
| 29 |
yield response
|
| 30 |
|
| 31 |
-
# Blue T3Sam3
|
| 32 |
custom_css = """
|
| 33 |
body, .gradio-container { background-color: #0b0f19 !important; }
|
| 34 |
footer {display: none !important}
|
|
@@ -36,15 +37,4 @@ footer {display: none !important}
|
|
| 36 |
.message.bot { background-color: #0f172a !important; color: #60a5fa !important; }
|
| 37 |
"""
|
| 38 |
|
| 39 |
-
|
| 40 |
-
gr.Markdown("# T3Sam3")
|
| 41 |
-
gr.ChatInterface(
|
| 42 |
-
fn=samaran_kernel_chat,
|
| 43 |
-
description="Samaran Kernel Intelligence Layer",
|
| 44 |
-
examples=[
|
| 45 |
-
"How does AI work?",
|
| 46 |
-
"Are black holes real?",
|
| 47 |
-
"How many Rs are in 'strawberry'?",
|
| 48 |
-
"What is the meaning of life?"
|
| 49 |
-
],
|
| 50 |
-
cache_
|
|
|
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
import os
|
| 4 |
|
| 5 |
+
# 1. Grab the secret password you just saved
|
| 6 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 7 |
|
| 8 |
+
# 2. Connect to the AI brain
|
| 9 |
client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct", token=HF_TOKEN)
|
| 10 |
|
| 11 |
+
# 3. The Samaran Kernel Logic
|
| 12 |
def samaran_kernel_chat(message, history):
|
| 13 |
system_message = "You are T3Sam3, the Samaran Kernel. Provide deep, blue-tier logic. Be witty and technical."
|
| 14 |
|
|
|
|
| 29 |
response += token
|
| 30 |
yield response
|
| 31 |
|
| 32 |
+
# 4. The Blue T3Sam3 Look
|
| 33 |
custom_css = """
|
| 34 |
body, .gradio-container { background-color: #0b0f19 !important; }
|
| 35 |
footer {display: none !important}
|
|
|
|
| 37 |
.message.bot { background-color: #0f172a !important; color: #60a5fa !important; }
|
| 38 |
"""
|
| 39 |
|
| 40 |
+
# 5. Build the Interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|