Spaces:
Sleeping
Sleeping
Zaheer Khan
commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,53 +1,55 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
models/codebert.py: CodeBERT model loading and analysis logic.
|
| 7 |
-
utils/code_utils.py: Pylint and Jupyter Notebook extraction utilities.
|
| 8 |
-
static/uploads/: Folder for uploaded files.
|
| 9 |
-
requirements.txt: Project dependencies.
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
-
Place the files in the structure described above.
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
-
Run:pip install -r requirements.txt
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
Navigate to the code_analyzer directory.
|
| 30 |
-
Run:streamlit run app.py
|
| 31 |
-
|
| 32 |
-
|
| 33 |
Open the provided URL (usually http://localhost:8501) in your browser.
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
Notes
|
| 44 |
-
|
| 45 |
-
Ensure the static/uploads folder is created automatically or manually before running.
|
| 46 |
-
If using a GPU, CodeBERT will utilize CUDA if available.
|
| 47 |
-
Check logs in the terminal for debugging information.
|
| 48 |
-
|
| 49 |
-
Troubleshooting
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: AI Assignment Checker
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: pink
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: "1.24.0"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
|
| 12 |
+
# π Code Analyzer
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
A **Streamlit-based application** to analyze **Python (.py)** and **Jupyter Notebook (.ipynb)** files using **CodeBERT** and **Pylint**.
|
| 15 |
|
| 16 |
+
---
|
| 17 |
|
| 18 |
+
## π Project Structure
|
|
|
|
| 19 |
|
| 20 |
+
- `app.py`: Main Streamlit application.
|
| 21 |
+
- `models/codebert.py`: CodeBERT model loading and analysis logic.
|
| 22 |
+
- `utils/code_utils.py`: Pylint and Jupyter Notebook extraction utilities.
|
| 23 |
+
- `static/uploads/`: Folder for uploaded files.
|
| 24 |
+
- `requirements.txt`: Project dependencies.
|
| 25 |
|
| 26 |
+
---
|
| 27 |
|
| 28 |
+
## βοΈ Setup Instructions
|
|
|
|
| 29 |
|
| 30 |
+
### 1. Clone or Set Up the Project
|
| 31 |
+
git clone https://github.com/<username>/<repo>.git
|
| 32 |
+
cd code_analyzer
|
| 33 |
|
| 34 |
+
### 2. Install Dependencies
|
| 35 |
+
Ensure Python 3.8+ is installed, then run:
|
| 36 |
+
pip install -r requirements.txt
|
| 37 |
|
| 38 |
+
### 3. Run the Application
|
| 39 |
+
streamlit run app.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
Open the provided URL (usually http://localhost:8501) in your browser.
|
| 41 |
|
| 42 |
+
## π Usage
|
| 43 |
+
### 1. Upload a .py or .ipynb file via the Streamlit UI.
|
| 44 |
+
### 2. View the analysis report with CodeBERT and Pylint feedback.
|
| 45 |
|
| 46 |
+
## π Notes
|
| 47 |
+
### 1. Ensure the static/uploads folder exists (create it manually if needed).
|
| 48 |
+
### 2. If using a GPU, CodeBERT will utilize CUDA if available.
|
| 49 |
+
### 3.Check logs in the terminal for debugging information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
+
## π οΈ Troubleshooting
|
| 52 |
+
### 1. Module Not Found β Verify all dependencies are installed:
|
| 53 |
+
pip install -r requirements.txt
|
| 54 |
+
### 2. File Upload Issues β Ensure files are valid .py or .ipynb.
|
| 55 |
+
### 3.CodeBERT Errors β Check internet connection for model downloading or GPU compatibility.
|