File size: 2,572 Bytes
107d57d
86cb57d
107d57d
86cb57d
 
 
 
 
 
 
 
 
 
 
23ebbfc
86cb57d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23ebbfc
86cb57d
 
 
 
 
 
 
 
 
 
 
 
 
23ebbfc
86cb57d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107d57d
86cb57d
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import gradio as gr
import os

def create_deepseek_interface():
    with gr.Blocks(theme="soft", fill_height=True) as demo:
        # Header Section
        gr.Markdown(
            """
            # πŸ€– DeepSeek V3 Inference Interface
            ### Advanced AI Model Powered by Fireworks AI
            """
        )
        
        # Sidebar with Model Information and Login
        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
                """
            )
            
            # Styled Login Button
            with gr.Row():
                button = gr.LoginButton(
                    "Sign In", 
                    variant="primary"
                )
            
            # Model Details Section
            gr.Markdown(
                """
                ### πŸ“Š Model Details
                - **Model**: DeepSeek-V3-0324
                - **Provider**: Fireworks AI
                - **Capabilities**: Advanced Language Understanding
                """
            )
        
        # Main Content Area
        with gr.Column():
            # Placeholder for model interaction
            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")
            
            # Button to clear chat history
            clear = gr.ClearButton([msg, chatbot], value="🧹 Clear Conversation")
        
        # Load Model with Authentication
        model = gr.load(
            "models/deepseek-ai/DeepSeek-V3-0324", 
            accept_token=button, 
            provider="fireworks-ai"
        )
        
        # Simple interaction setup (placeholder)
        submit.click(
            lambda x: x, 
            inputs=msg, 
            outputs=chatbot
        )
    
    return demo

# Launch the interface
demo = create_deepseek_interface()
demo.launch(debug=True)