Spaces:
Running
Running
Update app.py
Browse files2 unmodified lines34567897 unmodified lines1718192021222318 unmodified lines42434445464748164 unmodified lines2132142152162172182192202212222232242252262272 unmodified linesimport os# ============================================# GLM-4.7 Streaming Chat# Provider: Novita (HuggingFace)# Gradio 6.0 Compatible - Full Width Layout# ============================================7 unmodified linesdef chat_stream(messages):"""Streaming via Novita provider"""stream = client.chat.completions.create(model="zai-org/GLM-4.7",messages=messages,max_tokens=4096,temperature=0.7,18 unmodified lines# Build API messagesapi_messages = [{"role": "system","content": "You are GLM-4.7, a helpful AI assistant built by Zhipu AI. You excel at coding, reasoning, and creative tasks. Respond in the same language as the user."}]# Add history (Gradio 6.0 messages format)164 unmodified lines""")# Header Titlegr.Markdown("""# GLM-4.7 CHAT""", elem_classes="header-text")gr.Markdown("""<p class="subtitle">Zhipu AI's Latest Open Source Model - Powerful Reasoning and Coding Capabilities</p>""")# Model Info Boxgr.HTML("""<div style="background: linear-gradient(135deg, #10B981 0%, #3B82F6 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;"><div style="display: flex; justify-content: space-around; flex-wrap: wrap; text-align: center;"><div><strong style="font-size: 1.5rem;">GLM-4.7</strong><br><span style="font-size: 0.9rem;">Model</span></div><div><strong style="font-size: 1.5rem;">Zhipu AI</strong><br><span style="font-size: 0.9rem;">Developer</span></div><div><strong style="font-size: 1.5rem;">Open Source</strong><br><span style="font-size: 0.9rem;">License</span></div><div><strong style="font-size: 1.5rem;">Novita</strong><br><span style="font-size: 0.9rem;">Provider</span></div></div>2 unmodified lines34567897 unmodified lines1718192021222318 unmodified lines42434445464748164 unmodified lines2132142152162172182192202212222232242252262272 unmodified linesimport os# ============================================# DeepSeek-V3.2 Streaming Chat# Provider: Novita (HuggingFace)# Gradio 6.0 Compatible - Full Width Layout# ============================================7 unmodified linesdef chat_stream(messages):"""Streaming via Novita provider"""stream = client.chat.completions.create(model="deepseek-ai/DeepSeek-V3.2",messages=messages,max_tokens=4096,temperature=0.7,18 unmodified lines# Build API messagesapi_messages = [{"role": "system","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."}]# Add history (Gradio 6.0 messages format)164 unmodified lines""")# Header Titlegr.Markdown("""# DeepSeek-V3.2 CHAT""", elem_classes="header-text")gr.Markdown("""<p class="subtitle">DeepSeek's Most Powerful Open Source Model - State-of-the-Art Reasoning and Coding</p>""")# Model Info Boxgr.HTML("""<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;"><div style="display: flex; justify-content: space-around; flex-wrap: wrap; text-align: center;"><div><strong style="font-size: 1.5rem;">DeepSeek-V3.2</strong><br><span style="font-size: 0.9rem;">Model</span></div><div><strong style="font-size: 1.5rem;">DeepSeek</strong><br><span style="font-size: 0.9rem;">Developer</span></div><div><strong style="font-size: 1.5rem;">Open Source</strong><br><span style="font-size: 0.9rem;">License</span></div><div><strong style="font-size: 1.5rem;">Novita</strong><br><span style="font-size: 0.9rem;">Provider</span></div></div>
app.py+8-8