import gradio as gr from huggingface_hub import InferenceClient import os # --- BRANDING & IDENTITY --- TITLE = "馃拵 LPT-6 (Deta) | LiskCell Official Tester" SUBTITLE = "Experience the next generation of creative AI by LiskCell & xLYR." DESCRIPTION = """ Welcome to the testing sandbox for **LPT-6**, the flagship model of the **LiskCell** ecosystem. Natively powered by **Deta**, this model combines technical precision with an artistic soul. Founded by **liskasYR** (Yonatan Yosupov), LiskCell pushes the boundaries of AI, art, and music 馃幍. """ # Theme / CSS for Futuristic Look custom_css = """ body { background-color: #0b0f19; color: #e2e8f0; } .gradio-container { border: 1px solid #1e293b !important; border-radius: 20px !important; background: rgba(15, 23, 42, 0.8) !ax; backdrop-filter: blur(10px); } #component-0 { background: transparent !important; } .message.user { background-color: #1e293b !important; border-radius: 15px 15px 0 15px !important; } .message.bot { background-color: #0f172a !important; border: 1px solid #3b82f6 !important; border-radius: 15px 15px 15px 0 !important; } footer { display: none !important; } #title-header { text-align: center; margin-bottom: 20px; } #title-header h1 { color: #38bdf8; text-shadow: 0 0 10px rgba(56, 189, 248, 0.5); font-family: 'Inter', sans-serif; } """ # Initialize Inference Client # Note: Use an environment variable for the token in Space settings or a default public access if allowed. # For this tester, we'll try to use the model's inference endpoint. repo_id = "liskcell-company/lpt-6" client = InferenceClient(model=repo_id) def respond(message, history): messages = [] # Add System Prompt (Deta Persona) - although it's baked in, we reinforce it here for the UI # Since the user said it's "Baked in", we'll just send the chat history. for user_msg, assistant_msg in history: messages.append({"role": "user", "content": user_msg}) messages.append({"role": "assistant", "content": assistant_msg}) messages.append({"role": "user", "content": message}) response = "" try: # Stream the response for message_chunk in client.chat_completion( messages, max_tokens=1024, stream=True, temperature=0.7, top_p=0.9, ): token = message_chunk.choices[0].delta.content if token: response += token yield response except Exception as e: yield f"鈿狅笍 **Error:** {str(e)}\n\nPlease make sure the Inference Endpoint for {repo_id} is active." # Create the Gradio Interface with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo: with gr.Column(elem_id="title-header"): gr.Markdown(f"# {TITLE}") gr.Markdown(f"### {SUBTITLE}") gr.Markdown(DESCRIPTION) chatbot = gr.Chatbot( bubble_full_width=False, show_label=False, show_share_button=False, show_copy_button=True, layout="panel", height=600, ) with gr.Row(): msg = gr.Textbox( placeholder="Talk to Deta... (English or Hebrew)", show_label=False, scale=9, container=False ) submit_btn = gr.Button("馃殌 Send", scale=1, variant="primary") msg.submit(respond, [msg, chatbot], [chatbot]) msg.submit(lambda: "", None, [msg]) submit_btn.click(respond, [msg, chatbot], [chatbot]) submit_btn.click(lambda: "", None, [msg]) gr.Examples( examples=[ ["讛讬讬 Deta, 住驻专讬 诇讬 注诇 注爪诪讱 讜注诇 LiskCell."], ["What makes LPT-6 better than previous models?"], ["Could you help me brainstorm a concept for a futuristic music app?"], ["讻转讘讬 诇讬 砖讬专 拽爪专 注诇 注转讬讚 讛讟讻谞讜诇讜讙讬讛."] ], inputs=msg, label="Quick Examples" ) gr.Markdown("---") gr.Markdown("Powered by **LiskCell & xLYR** 馃拵 | Founded by **liskasYR**") if __name__ == "__main__": demo.launch()