--- title: DevDeCode emoji: ๐Ÿ’ก colorFrom: indigo colorTo: purple sdk: gradio sdk_version: 5.32.0 app_file: app.py pinned: false --- # ๐Ÿ’ก DevDeCode: Explain Code with LLM DevDeCode is a simple but powerful code explanation tool powered by **Google's Gemma 2B** and **LangChain**. Paste any code snippet (Java, Python, etc.), and get a natural-language explanation to help you understand what it does. > ๐Ÿง  Built using Hugging Face Transformers, LangChain, and Gradio. --- ## ๐Ÿš€ Features - ๐Ÿ“œ Explain small code snippets using LLM - ๐Ÿงฉ Supports languages like Java, Python (others can be added) - ๐ŸŒ Web-based interface via Gradio - ๐Ÿ”„ Can be extended with memory & history tracking --- ## ๐Ÿ›  Tech Stack | Tool / Library | Purpose | |------------------------|----------------------------------| | `transformers` | Load & run Gemma 2B | | `langchain` | LLM integration & prompt logic | | `huggingface_hub` | Auth & model access | | `gradio` | Frontend UI | | `torch` | Model backend (PyTorch) | | `langchain-huggingface`| LangChain-HF wrapper | --- ## ๐Ÿงช How to Use Just paste a code snippet into the textbox and click submit. The model will explain what the code does. โš ๏ธ **Note:** The response time may vary depending on your GPU and input length. Model is gated โ€” ensure you're authenticated. --- ## ๐Ÿงฉ Example Prompt public class Factorial { public static int factorial(int n) { if (n <= 1) return 1; return n * factorial(n - 1); } } ๐Ÿ‘† Get a clear explanation of recursion, factorial logic, and base conditions. --- ## ๐Ÿ” Hugging Face Token This model uses a gated Google Gemma 2B model. Make sure your Hugging Face token is set via: - Hugging Face Spaces secrets (`HF_TOKEN`) - Or via `huggingface-cli login` locally. --- ## ๐Ÿง  Coming Soon - Memory / Chat history support - Upload files for batch code analysis - Multi-language explanation support --- ๐Ÿ‘จโ€๐Ÿ’ป Created by [@itzsudipta](https://huggingface.co/sudiptaverse) ๐Ÿงช Try it now: [https://huggingface.co/spaces/sudiptaverse/DataSynth](https://huggingface.co/spaces/sudiptaverse/DevDeCode)