Update README.md
Browse files
README.md
CHANGED
|
@@ -20,85 +20,116 @@ tags:
|
|
| 20 |
- text-generation-inference
|
| 21 |
---
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
- **
|
| 30 |
-
|
| 31 |
-
- replit/replit-code-v1_5-3b
|
| 32 |
-
- WhiteRabbitNeo/Llama-3.1-WhiteRabbitNeo-2-8B
|
| 33 |
-
- WhiteRabbitNeo/Llama-3.1-WhiteRabbitNeo-2-70B
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
RabbitRedux is a cutting-edge code generation model designed to assist developers by generating code snippets, completing code blocks, and providing context-aware suggestions. It combines advanced AI architectures from Replit’s Code v1.5 and WhiteRabbitNeo's Llama series to produce high-quality code generation across multiple programming languages.
|
| 38 |
-
|
| 39 |
-
**Training Data**
|
| 40 |
|
| 41 |
-
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
| 51 |
-
-
|
| 52 |
-
- Canstralian/pentesting_dataset
|
| 53 |
-
- Canstralian/ShellCommands
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
-
- **Code Generation**: Creating boilerplate code or entire functions based on user inputs.
|
| 61 |
-
- **Educational Use**: Serving as a learning tool for exploring coding patterns and best practices.
|
| 62 |
-
|
| 63 |
-
**Performance Metrics**
|
| 64 |
-
|
| 65 |
-
RabbitRedux’s performance is evaluated using the following metrics:
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
|
| 75 |
-
- **Avoid Sensitive Inputs**: Do not input sensitive or proprietary information into the model to prevent data leakage.
|
| 76 |
|
| 77 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
|
|
|
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
|
| 86 |
-
|
|
|
|
|
|
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
| 90 |
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
-
|
|
|
|
|
|
|
| 96 |
|
| 97 |
-
|
| 98 |
-
- [WhiteRabbitNeo Llama-3.1 Model Cards](https://huggingface.co/WhiteRabbitNeo/Llama-3.1-WhiteRabbitNeo-2-8B)
|
| 99 |
-
- [Canstralian GitHub Repositories](https://github.com/canstralian)
|
| 100 |
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
| 102 |
|
|
|
|
| 103 |
|
|
|
|
| 104 |
|
|
|
|
|
|
| 20 |
- text-generation-inference
|
| 21 |
---
|
| 22 |
|
| 23 |
+
# 🐇 RabbitRedux Code Classification Model
|
| 24 |
|
| 25 |
+
## 🔍 Overview
|
| 26 |
+
The **RabbitRedux Code Classification Model** is a transformer-based AI designed for **code classification** in **cybersecurity** and **software engineering** contexts.
|
| 27 |
|
| 28 |
+
### 🧠 Features
|
| 29 |
+
✅ **Pre-trained on diverse datasets**
|
| 30 |
+
✅ **Fine-tuned for cybersecurity-focused classification**
|
| 31 |
+
✅ **Optimized for Python, JavaScript, and more**
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
## 🚀 Usage
|
| 36 |
|
| 37 |
+
### **1️⃣ Install Dependencies**
|
| 38 |
+
```sh
|
| 39 |
+
pip install transformers torch
|
| 40 |
+
```
|
| 41 |
|
| 42 |
+
### **2️⃣ Load the Model**
|
| 43 |
+
```python
|
| 44 |
+
from transformers import pipeline
|
| 45 |
|
| 46 |
+
# Load RabbitRedux
|
| 47 |
+
classifier = pipeline("text-classification", model="canstralian/RabbitRedux")
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
# Example classification
|
| 50 |
+
code_snippet = "def hello_world():\n print('Hello, world!')"
|
| 51 |
+
result = classifier(code_snippet)
|
| 52 |
+
print(result)
|
| 53 |
+
```
|
| 54 |
|
| 55 |
+
### **3️⃣ Example Output**
|
| 56 |
+
```json
|
| 57 |
+
[
|
| 58 |
+
{"label": "Python Function", "score": 0.98}
|
| 59 |
+
]
|
| 60 |
+
```
|
| 61 |
|
| 62 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
+
## 📊 Model Details
|
| 65 |
+
• **Developed by**: canstralian
|
| 66 |
+
• **Architecture**: Transformer-based (Fine-tuned)
|
| 67 |
+
• **Training Datasets**:
|
| 68 |
+
- Canstralian/Wordlists
|
| 69 |
+
- Canstralian/CyberExploitDB
|
| 70 |
+
- Canstralian/pentesting_dataset
|
| 71 |
+
- Canstralian/ShellCommands
|
| 72 |
+
• **Fine-tuned from**:
|
| 73 |
+
- replit/replit-code-v1_5-3b
|
| 74 |
+
- WhiteRabbitNeo/Llama-3.1-WhiteRabbitNeo-2-8B
|
| 75 |
+
- WhiteRabbitNeo/Llama-3.1-WhiteRabbitNeo-2-70B
|
| 76 |
+
• **License**: MIT
|
| 77 |
+
|
| 78 |
+
## 🏆 Performance
|
| 79 |
+
|
| 80 |
+
| Metric | Value |
|
| 81 |
+
|------------|----------|
|
| 82 |
+
| Accuracy | 94.5% |
|
| 83 |
+
| F1 Score | 92.8% |
|
| 84 |
|
| 85 |
+
---
|
| 86 |
|
| 87 |
+
## 🔥 Deployment
|
| 88 |
|
| 89 |
+
You can deploy this model as an API using Hugging Face Spaces.
|
|
|
|
| 90 |
|
| 91 |
+
### **Deploy with Docker**
|
| 92 |
+
```sh
|
| 93 |
+
docker build -t rabbitredux .
|
| 94 |
+
docker run -p 5000:5000 rabbitredux
|
| 95 |
+
```
|
| 96 |
|
| 97 |
+
### **Use with FastAPI**
|
| 98 |
+
If you want a scalable API:
|
| 99 |
|
| 100 |
+
```sh
|
| 101 |
+
pip install fastapi uvicorn
|
| 102 |
+
```
|
| 103 |
|
| 104 |
+
Then, create a FastAPI server:
|
| 105 |
|
| 106 |
+
```python
|
| 107 |
+
from fastapi import FastAPI
|
| 108 |
+
from transformers import pipeline
|
| 109 |
|
| 110 |
+
app = FastAPI()
|
| 111 |
+
classifier = pipeline("text-classification", model="canstralian/RabbitRedux")
|
| 112 |
|
| 113 |
+
@app.post("/classify/")
|
| 114 |
+
def classify_code(data: dict):
|
| 115 |
+
return {"classification": classifier(data["code"])}
|
| 116 |
+
```
|
| 117 |
|
| 118 |
+
Run with:
|
| 119 |
|
| 120 |
+
```sh
|
| 121 |
+
uvicorn app:app --host 0.0.0.0 --port 8000
|
| 122 |
+
```
|
| 123 |
|
| 124 |
+
---
|
|
|
|
|
|
|
| 125 |
|
| 126 |
+
## 📚 Useful Resources
|
| 127 |
+
• **GitHub**: [canstralian](https://github.com/canstralian)
|
| 128 |
+
• **Hugging Face Model**: [RabbitRedux](https://huggingface.co/canstralian/RabbitRedux)
|
| 129 |
+
• **Replit Profile**: [canstralian](https://replit.com/@canstralian)
|
| 130 |
|
| 131 |
+
---
|
| 132 |
|
| 133 |
+
## 📜 License
|
| 134 |
|
| 135 |
+
Licensed under the **MIT License**.
|