""" Temporary maintenance mode for your HF Space Upload this as app.py until your model is ready! """ import gradio as gr from datetime import datetime def maintenance_message(user_input): """Show friendly maintenance message""" message = f""" 🚧 **MAINTENANCE MODE** 🚧 Hey there! Thanks for checking out Fyodor-Demo! **Current Status:** Model is being reconstructed and converted to proper format. **What's happening:** - ⚙️ Converting model weights to SafeTensors - 🔧 Fixing custom MoE architecture compatibility - 🏗️ Rebuilding inference endpoint - 📝 Updating model files on HuggingFace **Why is this down?** I got a bit excited and deployed the frontend before the backend was ready... 😅 Classic "building the restaurant before stocking the kitchen" moment! **When will it be ready?** Hopefully within a few hours! The model is being reconstructed right now. **What you tried to generate:** `{user_input}` I promise it'll work soon! Check back later! 🚀 --- **Last Updated:** {datetime.now().strftime("%Y-%m-%d %H:%M UTC")} **Follow progress:** Check the model repo for updates! """ return message # Create a nice maintenance interface with gr.Blocks(theme=gr.themes.Soft()) as demo: gr.Markdown(""" # 🔧 Fyodor-StarCoder2-7B-Instruct-Agentic ## ⚠️ Currently Under Maintenance """) gr.Markdown(""" This is a **Mixture-of-Experts (MoE)** enhanced StarCoder2 model with 6 experts and top-2 routing. **Once operational, this model will be able to:** - 🐍 Generate Python code - 🔧 Handle function calling and API usage - 🤖 Perform agentic task decomposition - 📝 Write technical documentation **But right now:** It's being reconstructed! 😅 """) with gr.Row(): with gr.Column(): user_input = gr.Textbox( label="What would you like to generate?", placeholder="e.g., 'Write a function to sort a list'", lines=5 ) submit_btn = gr.Button("Check Status", variant="primary", size="lg") with gr.Column(): output = gr.Textbox( label="Status Update", lines=15, interactive=False ) submit_btn.click( fn=maintenance_message, inputs=[user_input], outputs=[output] ) gr.Markdown(""" --- ### 📋 Technical Details (for the curious) **Why the reconstruction?** - Original model used custom `fyodor_starcoder` architecture - Transformers library didn't recognize it - Need to properly register the custom MoE architecture - Converting from PyTorch to SafeTensors format **Model Specs:** - Base: StarCoder2-7B - MoE Layers: 4 layers with 6 experts each - Routing: Top-2 expert selection - Training: 43k samples across code and chat datasets **Star the repo if you're interested!** ⭐ **Questions?** Open an issue on the model repo! """) gr.Markdown(""" ---

Model by Khoi | Built with 💪 and too much enthusiasm

"I deployed before I tested. Classic move." - Every ML Engineer Ever

""") if __name__ == "__main__": demo.launch()