Spaces:
Running
Running
Update README.md
Browse filesAdded Description
README.md
CHANGED
@@ -1,13 +1,115 @@
|
|
1 |
---
|
2 |
title: WhatTheCode
|
3 |
-
emoji:
|
4 |
colorFrom: gray
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 5.36.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
---
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
1 |
---
|
2 |
title: WhatTheCode
|
3 |
+
emoji: π»
|
4 |
colorFrom: gray
|
5 |
+
colorTo: indigo
|
6 |
sdk: gradio
|
|
|
7 |
app_file: app.py
|
8 |
pinned: false
|
9 |
license: mit
|
10 |
+
short_description: WhatTheCode π is a fun, dev-centric solution explainer
|
11 |
+
---
|
12 |
+
# WhatTheCode π»π€―
|
13 |
+
_βBecause sometimes your own code feels like decoding an encrypted puzzle.β_
|
14 |
+
|
15 |
+
---
|
16 |
+
|
17 |
+

|
18 |
+

|
19 |
+

|
20 |
+

|
21 |
+

|
22 |
+
|
23 |
+
---
|
24 |
+
|
25 |
+
## π― Overview
|
26 |
+
|
27 |
+
**WhatTheCode π** is a fun, dev-centric Leetcode solution explainer that turns your raw code or problem description into clean, structured, and markdown-ready explanations β perfect for:
|
28 |
+
|
29 |
+
- Future self-reviews π§
|
30 |
+
- Leetcode Discuss posts π¬
|
31 |
+
- Understanding alien π½ code
|
32 |
+
- Teaching others (or learning from your past logic)
|
33 |
+
|
34 |
+
No fluff. No academic jargon. Just structured, fun, markdown-formatted explanations that feel like a dev wrote them at 2 AM with pizza in hand and Stack Overflow tabs open.
|
35 |
+
|
36 |
---
|
37 |
|
38 |
+
## π Features
|
39 |
+
|
40 |
+
- βοΈ **Instant Markdown Explanations**
|
41 |
+
Paste your Leetcode code or problem, click a button β get a full explanation with:
|
42 |
+
- `## Intuition π‘`
|
43 |
+
- `## Approach πͺ`
|
44 |
+
- `## Complexity β³`
|
45 |
+
- `## Code π¨π½βπ»`
|
46 |
+
- Optional: `## Alternate π`
|
47 |
+
|
48 |
+
- π€ **Prompt Engineered Output**
|
49 |
+
Built on top of Groq + Meta-LLaMA 4, carefully tuned with a cheeky, dev-friendly tone.
|
50 |
+
|
51 |
+
- π **Alternate Solution Generator**
|
52 |
+
Got time? Ask it to cook up a different approach with one click.
|
53 |
+
|
54 |
+
- π¦ **Copy-Paste Ready Markdown Tab**
|
55 |
+
Designed for fast Leetcode Discuss uploads.
|
56 |
+
|
57 |
+
---
|
58 |
+
|
59 |
+
## π οΈ Tech Stack
|
60 |
+
|
61 |
+
- `Gradio ` β Frontend & interactivity
|
62 |
+
- `Python` β Core logic
|
63 |
+
- `Groq API` β LLM backend (Meta LLaMA-4)
|
64 |
+
- `.env` & HuggingFace Secrets β for secure prompt/key handling
|
65 |
+
|
66 |
+
---
|
67 |
+
|
68 |
+
## βοΈ How to Use Locally
|
69 |
+
|
70 |
+
1. Clone the repo
|
71 |
+
```bash
|
72 |
+
git clone https://huggingface.co/spaces/<your-username>/WhatTheCode
|
73 |
+
cd WhatTheCode
|
74 |
+
```
|
75 |
+
|
76 |
+
2. Install dependencies
|
77 |
+
```bash
|
78 |
+
pip install -r requirements.txt
|
79 |
+
```
|
80 |
+
|
81 |
+
3. Add a `.env` file:
|
82 |
+
```
|
83 |
+
GROQ_API_KEY=your_groq_key_here
|
84 |
+
MAGIC_PROMPT="Your prompt string..."
|
85 |
+
```
|
86 |
+
|
87 |
+
4. Run it locally:
|
88 |
+
```bash
|
89 |
+
python app.py
|
90 |
+
```
|
91 |
+
|
92 |
+
---
|
93 |
+
|
94 |
+
## π‘ Deploy on Hugging Face Spaces
|
95 |
+
|
96 |
+
1. Push your repo to Hugging Face
|
97 |
+
2. Go to `Settings > Secrets` and add:
|
98 |
+
- `GROQ_API_KEY`
|
99 |
+
- `PROMPT_ADVANCE` (optional)
|
100 |
+
3. Hit βRestart Spaceβ β and you're live!
|
101 |
+
|
102 |
+
---
|
103 |
+
|
104 |
+
## π¨ App Metadata
|
105 |
+
|
106 |
+
```yaml
|
107 |
+
title: WhatTheCode
|
108 |
+
emoji: π
|
109 |
+
colorFrom: gray
|
110 |
+
colorTo: purple
|
111 |
+
sdk: gradio
|
112 |
+
app_file: app.py
|
113 |
+
license: mit
|
114 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
115 |
+
```
|