Spaces:
Runtime error
Runtime error
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,12 +1,82 @@
|
|
| 1 |
---
|
| 2 |
title: DevDeCode
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: DevDeCode
|
| 3 |
+
emoji: π‘
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: purple # Changed from violet to purple (valid color)
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: "4.27.0"
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# π‘ DevDeCode: Explain Code with LLM
|
| 13 |
+
|
| 14 |
+
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.
|
| 15 |
+
|
| 16 |
+
> π§ Built using Hugging Face Transformers, LangChain, and Gradio.
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## π Features
|
| 21 |
+
|
| 22 |
+
- π Explain small code snippets using LLM
|
| 23 |
+
- π§© Supports languages like Java, Python (others can be added)
|
| 24 |
+
- π Web-based interface via Gradio
|
| 25 |
+
- π Can be extended with memory & history tracking
|
| 26 |
+
|
| 27 |
+
---
|
| 28 |
+
|
| 29 |
+
## π Tech Stack
|
| 30 |
+
|
| 31 |
+
| Tool / Library | Purpose |
|
| 32 |
+
|------------------------|----------------------------------|
|
| 33 |
+
| `transformers` | Load & run Gemma 2B |
|
| 34 |
+
| `langchain` | LLM integration & prompt logic |
|
| 35 |
+
| `huggingface_hub` | Auth & model access |
|
| 36 |
+
| `gradio` | Frontend UI |
|
| 37 |
+
| `torch` | Model backend (PyTorch) |
|
| 38 |
+
| `langchain-huggingface`| LangChain-HF wrapper |
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## π§ͺ How to Use
|
| 43 |
+
|
| 44 |
+
Just paste a code snippet into the textbox and click submit. The model will explain what the code does.
|
| 45 |
+
|
| 46 |
+
β οΈ **Note:** The response time may vary depending on your GPU and input length. Model is gated β ensure you're authenticated.
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## π§© Example Prompt
|
| 51 |
+
|
| 52 |
+
public class Factorial {
|
| 53 |
+
public static int factorial(int n) {
|
| 54 |
+
if (n <= 1) return 1;
|
| 55 |
+
return n * factorial(n - 1);
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
π Get a clear explanation of recursion, factorial logic, and base conditions.
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## π Hugging Face Token
|
| 65 |
+
|
| 66 |
+
This model uses a gated Google Gemma 2B model. Make sure your Hugging Face token is set via:
|
| 67 |
+
|
| 68 |
+
- Hugging Face Spaces secrets (`HF_TOKEN`)
|
| 69 |
+
- Or via `huggingface-cli login` locally.
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
## π§ Coming Soon
|
| 74 |
+
|
| 75 |
+
- Memory / Chat history support
|
| 76 |
+
- Upload files for batch code analysis
|
| 77 |
+
- Multi-language explanation support
|
| 78 |
+
|
| 79 |
+
---
|
| 80 |
+
|
| 81 |
+
π¨βπ» Created by [@itzsudipta](https://huggingface.co/sudiptaverse)
|
| 82 |
+
π§ͺ Try it now: [https://huggingface.co/spaces/sudiptaverse/DataSynth](https://huggingface.co/spaces/sudiptaverse/DevDeCode)
|