Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ from huggingface_hub import InferenceClient
|
|
| 3 |
import os
|
| 4 |
|
| 5 |
# ============================================
|
| 6 |
-
#
|
| 7 |
# Provider: Novita (HuggingFace)
|
| 8 |
# Gradio 6.0 Compatible - Full Width Layout
|
| 9 |
# ============================================
|
|
@@ -17,7 +17,7 @@ client = InferenceClient(
|
|
| 17 |
def chat_stream(messages):
|
| 18 |
"""Streaming via Novita provider"""
|
| 19 |
stream = client.chat.completions.create(
|
| 20 |
-
model="
|
| 21 |
messages=messages,
|
| 22 |
max_tokens=4096,
|
| 23 |
temperature=0.7,
|
|
@@ -42,7 +42,7 @@ def chat_respond(message, history):
|
|
| 42 |
# Build API messages
|
| 43 |
api_messages = [{
|
| 44 |
"role": "system",
|
| 45 |
-
"content": "You are
|
| 46 |
}]
|
| 47 |
|
| 48 |
# Add history (Gradio 6.0 messages format)
|
|
@@ -213,15 +213,15 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 213 |
""")
|
| 214 |
|
| 215 |
# Header Title
|
| 216 |
-
gr.Markdown("""#
|
| 217 |
-
gr.Markdown("""<p class="subtitle">
|
| 218 |
|
| 219 |
# Model Info Box
|
| 220 |
gr.HTML("""
|
| 221 |
-
<div style="background: linear-gradient(135deg, #
|
| 222 |
<div style="display: flex; justify-content: space-around; flex-wrap: wrap; text-align: center;">
|
| 223 |
-
<div><strong style="font-size: 1.5rem;">
|
| 224 |
-
<div><strong style="font-size: 1.5rem;">
|
| 225 |
<div><strong style="font-size: 1.5rem;">Open Source</strong><br><span style="font-size: 0.9rem;">License</span></div>
|
| 226 |
<div><strong style="font-size: 1.5rem;">Novita</strong><br><span style="font-size: 0.9rem;">Provider</span></div>
|
| 227 |
</div>
|
|
|
|
| 3 |
import os
|
| 4 |
|
| 5 |
# ============================================
|
| 6 |
+
# DeepSeek-V3.2 Streaming Chat
|
| 7 |
# Provider: Novita (HuggingFace)
|
| 8 |
# Gradio 6.0 Compatible - Full Width Layout
|
| 9 |
# ============================================
|
|
|
|
| 17 |
def chat_stream(messages):
|
| 18 |
"""Streaming via Novita provider"""
|
| 19 |
stream = client.chat.completions.create(
|
| 20 |
+
model="deepseek-ai/DeepSeek-V3.2",
|
| 21 |
messages=messages,
|
| 22 |
max_tokens=4096,
|
| 23 |
temperature=0.7,
|
|
|
|
| 42 |
# Build API messages
|
| 43 |
api_messages = [{
|
| 44 |
"role": "system",
|
| 45 |
+
"content": "You are DeepSeek-V3.2, a helpful AI assistant built by DeepSeek. You excel at coding, reasoning, and creative tasks. Respond in the same language as the user."
|
| 46 |
}]
|
| 47 |
|
| 48 |
# Add history (Gradio 6.0 messages format)
|
|
|
|
| 213 |
""")
|
| 214 |
|
| 215 |
# Header Title
|
| 216 |
+
gr.Markdown("""# DeepSeek-V3.2 CHAT""", elem_classes="header-text")
|
| 217 |
+
gr.Markdown("""<p class="subtitle">DeepSeek's Most Powerful Open Source Model - State-of-the-Art Reasoning and Coding</p>""")
|
| 218 |
|
| 219 |
# Model Info Box
|
| 220 |
gr.HTML("""
|
| 221 |
+
<div style="background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%); border: 3px solid #1F2937; border-radius: 12px; padding: 15px; color: white; box-shadow: 5px 5px 0px #1F2937; margin: 0 auto 20px auto; max-width: 1200px;">
|
| 222 |
<div style="display: flex; justify-content: space-around; flex-wrap: wrap; text-align: center;">
|
| 223 |
+
<div><strong style="font-size: 1.5rem;">DeepSeek-V3.2</strong><br><span style="font-size: 0.9rem;">Model</span></div>
|
| 224 |
+
<div><strong style="font-size: 1.5rem;">DeepSeek</strong><br><span style="font-size: 0.9rem;">Developer</span></div>
|
| 225 |
<div><strong style="font-size: 1.5rem;">Open Source</strong><br><span style="font-size: 0.9rem;">License</span></div>
|
| 226 |
<div><strong style="font-size: 1.5rem;">Novita</strong><br><span style="font-size: 0.9rem;">Provider</span></div>
|
| 227 |
</div>
|