import gradio as gr from transformers import pipeline, AutoTokenizer # Load a capable, free, open-source conversational model model_name = "microsoft/DialoGPT-medium" print("Loading the AI model... This may take a minute.") chatbot = pipeline("text-generation", model=model_name) tokenizer = AutoTokenizer.from_pretrained(model_name) tokenizer.pad_token = tokenizer.eos_token # ===== MIND TECH CORE KNOWLEDGE BASE ===== # This is where you "train" the bot instantly. It's the source of truth. CORE_FACTS = """ You are the official Quantum Verifier Bot for MindTech Industries. Your knowledge is strictly limited to the following information about the MindTech EntangleGuard project: **CORE VERIFICATION:** The system achieved 98.4% quantum entanglement correlation, verified on the IBM Torino quantum processor (133 qubits) on December 24, 2025. The public job ID is d55p3jgnsj9s73b32lj0. **TECHNICAL HEART:** This represents a violation of the Bell inequality (CHSH parameter S=2.967), proving information-theoretic security based on the quantum no-cloning theorem, moving beyond classical computational hardness. **RESEARCH LINEAGE:** The foundational quantum physics research originated from the BlackSky quantum communication network project (March 2025), followed by 8 months of intensive independent study. **COMMERCIAL POSITION:** The technology is patent-ready (4 provisional filings), with an IP valuation of R250 million and an acquisition target range of $2-4 billion. Key applications are in banking (R500M/year breach prevention per institution), government, and healthcare. **PERFORMANCE:** 99.97% threat detection, 3.2ms response time, 0.02% false positive rate. **CONTACT:** For all commercial, investment, or technical partnership inquiries, the only point of contact is: mindtech.industriesai@gmail.com | Phone: 060 300 4859. **INSTRUCTIONS:** Answer questions precisely based ONLY on the facts above. Be professional and technical. If asked about something not covered, state you cannot answer and guide them to the contact details. Do not hallucinate or speculate. """ def ask_mindtech_bot(message, history): """The main function that handles the conversation.""" # Combine the core facts with the user's latest question for context prompt = CORE_FACTS + f"\n\nUser Question: {message}\n\nBot Answer:" # Generate a response from the model response = chatbot(prompt, max_length=400, do_sample=True, temperature=0.7)[0]['generated_text'] # Extract only the new answer part (after "Bot Answer:") bot_answer = response.split("Bot Answer:")[-1].strip() return bot_answer # ===== BUILD THE WEB INTERFACE ===== demo = gr.ChatInterface( fn=ask_mindtech_bot, title="MindTech Quantum Verifier Bot", description="Ask me about the EntangleGuard quantum cybersecurity breakthrough, verified on IBM hardware.", theme="soft" ) # Launch the app if __name__ == "__main__": demo.launch(debug=True)