Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import json
|
|
| 5 |
|
| 6 |
# These will be set as Hugging Face Spaces secrets
|
| 7 |
API_KEY = os.environ.get("FIREWORKS_API_KEY", "")
|
| 8 |
-
SYSTEM_PROMPT = os.environ.get("SYSTEM_PROMPT"
|
| 9 |
|
| 10 |
# API endpoint
|
| 11 |
API_URL = "https://api.fireworks.ai/inference/v1/chat/completions"
|
|
@@ -109,7 +109,7 @@ footer {
|
|
| 109 |
|
| 110 |
# Create Gradio interface
|
| 111 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft(primary_hue="purple", secondary_hue="pink")) as demo:
|
| 112 |
-
gr.HTML("<h1 id='title'
|
| 113 |
gr.HTML("<p id='subtitle'>Intelligent conversations powered by advanced language models</p>")
|
| 114 |
|
| 115 |
with gr.Row():
|
|
@@ -189,15 +189,7 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft(primary_hue="purple", second
|
|
| 189 |
balanced_btn = gr.Button("⚖️ Balanced", size="sm")
|
| 190 |
precise_btn = gr.Button("🎯 Precise", size="sm")
|
| 191 |
|
| 192 |
-
|
| 193 |
-
gr.Markdown("### 🔧 Setup Guide")
|
| 194 |
-
gr.Markdown("""
|
| 195 |
-
**Space Settings → Secrets:**
|
| 196 |
-
- `FIREWORKS_API_KEY`
|
| 197 |
-
- `SYSTEM_PROMPT`
|
| 198 |
-
|
| 199 |
-
Then restart your Space ♻️
|
| 200 |
-
""")
|
| 201 |
|
| 202 |
# Handle message submission with streaming
|
| 203 |
def respond(message, chat_history, temp, max_tok, top_p_val, top_k_val):
|
|
@@ -260,9 +252,9 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft(primary_hue="purple", second
|
|
| 260 |
# Add examples
|
| 261 |
gr.Examples(
|
| 262 |
examples=[
|
| 263 |
-
["
|
| 264 |
-
["
|
| 265 |
-
["
|
| 266 |
["What are the best practices for Python code?"],
|
| 267 |
],
|
| 268 |
inputs=msg,
|
|
|
|
| 5 |
|
| 6 |
# These will be set as Hugging Face Spaces secrets
|
| 7 |
API_KEY = os.environ.get("FIREWORKS_API_KEY", "")
|
| 8 |
+
SYSTEM_PROMPT = os.environ.get("SYSTEM_PROMPT")
|
| 9 |
|
| 10 |
# API endpoint
|
| 11 |
API_URL = "https://api.fireworks.ai/inference/v1/chat/completions"
|
|
|
|
| 109 |
|
| 110 |
# Create Gradio interface
|
| 111 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft(primary_hue="purple", secondary_hue="pink")) as demo:
|
| 112 |
+
gr.HTML("<h1 id='title'>Palmyra-Sec Playground</h1>")
|
| 113 |
gr.HTML("<p id='subtitle'>Intelligent conversations powered by advanced language models</p>")
|
| 114 |
|
| 115 |
with gr.Row():
|
|
|
|
| 189 |
balanced_btn = gr.Button("⚖️ Balanced", size="sm")
|
| 190 |
precise_btn = gr.Button("🎯 Precise", size="sm")
|
| 191 |
|
| 192 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
|
| 194 |
# Handle message submission with streaming
|
| 195 |
def respond(message, chat_history, temp, max_tok, top_p_val, top_k_val):
|
|
|
|
| 252 |
# Add examples
|
| 253 |
gr.Examples(
|
| 254 |
examples=[
|
| 255 |
+
["Analyze the risks of CVE-2025-1234. Explain the root cause, attack vector, possible business impact, and give me defensive actions. Also map the mitigations to NIST and ISO 27001 controls."],
|
| 256 |
+
["A financial services company detected unusual outbound traffic from an internal SQL server at 2am. Provide an executive summary of what might be happening, a technical analysis, likely MITRE ATT&CK techniques, and immediate incident response steps the SOC should take."],
|
| 257 |
+
["We are preparing for a SOC-2 audit. Draft a short security policy on how our engineering team should handle secrets (API keys, SSH keys, environment variables) in source code and CI/CD pipelines. Include recommended tools and preventive controls."],
|
| 258 |
["What are the best practices for Python code?"],
|
| 259 |
],
|
| 260 |
inputs=msg,
|