File size: 2,271 Bytes
5e78d17
 
918a19e
 
709432f
5e78d17
709432f
5e78d17
 
 
 
918a19e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
709432f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
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)