|
import gradio as gr |
|
import os |
|
|
|
def create_deepseek_interface(): |
|
with gr.Blocks(theme="soft", fill_height=True) as demo: |
|
|
|
gr.Markdown( |
|
""" |
|
# π€ DeepSeek V3 Inference Interface |
|
### Advanced AI Model Powered by Fireworks AI |
|
""" |
|
) |
|
|
|
|
|
with gr.Sidebar(): |
|
gr.Markdown( |
|
""" |
|
## π Access Control |
|
### Inference Provider |
|
This Space showcases the DeepSeek-V3-0324 model, |
|
served by the Fireworks AI API. |
|
|
|
#### Authentication |
|
- Sign in with your Hugging Face account |
|
- Secure API access |
|
""" |
|
) |
|
|
|
|
|
with gr.Row(): |
|
button = gr.LoginButton( |
|
"Sign In", |
|
variant="primary" |
|
) |
|
|
|
|
|
gr.Markdown( |
|
""" |
|
### π Model Details |
|
- **Model**: DeepSeek-V3-0324 |
|
- **Provider**: Fireworks AI |
|
- **Capabilities**: Advanced Language Understanding |
|
""" |
|
) |
|
|
|
|
|
with gr.Column(): |
|
|
|
chatbot = gr.Chatbot( |
|
height=500, |
|
placeholder="Model is ready. Please authenticate to begin.", |
|
label="DeepSeek V3 Chat" |
|
) |
|
|
|
with gr.Row(): |
|
msg = gr.Textbox( |
|
label="Your Message", |
|
placeholder="Type your prompt here...", |
|
show_label=True |
|
) |
|
submit = gr.Button("Send", variant="primary") |
|
|
|
|
|
clear = gr.ClearButton([msg, chatbot], value="π§Ή Clear Conversation") |
|
|
|
|
|
model = gr.load( |
|
"models/deepseek-ai/DeepSeek-V3-0324", |
|
accept_token=button, |
|
provider="fireworks-ai" |
|
) |
|
|
|
|
|
submit.click( |
|
lambda x: x, |
|
inputs=msg, |
|
outputs=chatbot |
|
) |
|
|
|
return demo |
|
|
|
|
|
demo = create_deepseek_interface() |
|
demo.launch(debug=True) |