Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog

## [Unreleased] - Fix Python Compatibility Issues

### Fixed
- Fixed Python 3.13 compatibility issue with `blis==1.2.0` by documenting Python version requirements (3.9-3.11)
- Fixed `torch==2.4.1` installation by installing from PyTorch repository instead of PyPI
- Fixed NumPy 2.x compatibility issues by constraining to `numpy<2.0` for spacy/thinc compatibility
- Improved `setup.sh` with Python version detection and proper dependency installation order
- Updated README with comprehensive installation instructions and troubleshooting section

### Changed
- Updated `requirements.txt` to remove torch (installed separately) and constrain NumPy version
- Enhanced `setup.sh` with error handling and version checking
- Updated README with Python version requirements and alternative installation methods

### Added
- Added `.python-version` file to specify recommended Python version
- Added comprehensive troubleshooting section to README
- Added Python version detection in setup script

### Technical Details
- **Python Compatibility**: Now explicitly supports Python 3.9, 3.10, and 3.11
- **PyTorch Installation**: Uses PyTorch repository for better version compatibility
- **NumPy Version**: Constrained to <2.0 to avoid compatibility issues with spacy/thinc
- **Dependency Order**: Setup script now installs dependencies in correct order

45 changes: 39 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Transform AI-generated text into **formal, human-like, and academic writing** with ease, avoids AI detector! πŸš€

![Streamlit](https://img.shields.io/badge/Streamlit-Web_App-red?style=flat-square&logo=streamlit)
![Python](https://img.shields.io/badge/Python-3.10-blue?style=flat-square&logo=python)
![Python](https://img.shields.io/badge/Python-3.9%20%7C%203.10%20%7C%203.11-blue?style=flat-square&logo=python)
![License](https://img.shields.io/github/license/DadaNanjesha/AI-Text-Humanizer-App?style=flat-square)


Expand Down Expand Up @@ -32,6 +32,11 @@ Building new version of this project here in this repos https://github.com/DadaN

## πŸ“₯ Installation

### ⚠️ Python Version Requirements
- **Required**: Python 3.9, 3.10, or 3.11
- **Not supported**: Python 3.12+ (dependency compatibility issues)
- **Not supported**: Python 3.8 or earlier

### 1️⃣ Clone the Repository
```bash
git clone https://github.com/DadaNanjesha/AI-Text-Humanizer-App.git
Expand All @@ -40,23 +45,51 @@ cd AI-Text-Humanizer-App

### 2️⃣ Set Up a Virtual Environment (Recommended)
```bash
python -m venv venv
python3.11 -m venv venv # Use Python 3.9, 3.10, or 3.11
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
```

### 3️⃣ Install Dependencies

**Option A: Using setup.sh (Recommended)**
```bash
pip install --upgrade pip
pip install -r requirements.txt
chmod +x setup.sh
./setup.sh
```

### 4️⃣ Download NLP Models
**Option B: Manual Installation**
```bash
pip install --upgrade pip setuptools wheel

# Install NumPy first (must be <2.0 for compatibility)
pip install "numpy<2.0"

# Install PyTorch from PyTorch repository
pip install torch --index-url https://download.pytorch.org/whl/cpu

# Install other dependencies
pip install -r requirements.txt

# Download NLP models
python -m spacy download en_core_web_sm
python -c "import nltk; nltk.download('punkt'); nltk.download('wordnet'); nltk.download('averaged_perceptron_tagger');"
python -c "import nltk; nltk.download('punkt', quiet=True); nltk.download('wordnet', quiet=True); nltk.download('averaged_perceptron_tagger', quiet=True)"
```

### πŸ”§ Troubleshooting

**Issue: `blis==1.2.0` installation fails**
- **Solution**: Use Python 3.9-3.11. Python 3.12+ is not supported.

**Issue: `torch==2.4.1` not found**
- **Solution**: Install torch from PyTorch repository: `pip install torch --index-url https://download.pytorch.org/whl/cpu`

**Issue: NumPy compatibility warnings**
- **Solution**: NumPy 2.x is not compatible. The setup script automatically installs NumPy <2.0.

**Issue: spaCy model download fails**
- **Solution**: Ensure you have internet connection and try: `python -m spacy download en_core_web_sm`

---

## πŸ–₯️ Usage
Expand Down
Binary file modified requirements.txt
Binary file not shown.
61 changes: 54 additions & 7 deletions setup.sh
100644 β†’ 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,61 @@
#!/usr/bin/env bash

echo "Installing pip dependencies..."
pip install --upgrade pip
# AI Text Humanizer App - Setup Script
# This script handles dependency installation with proper version compatibility

set -e # Exit on error

echo "πŸ”§ Setting up AI Text Humanizer App..."

# Check Python version
PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}' | cut -d. -f1,2)
PYTHON_MAJOR=$(echo $PYTHON_VERSION | cut -d. -f1)
PYTHON_MINOR=$(echo $PYTHON_VERSION | cut -d. -f2)

echo "πŸ“Œ Detected Python version: $PYTHON_VERSION"

# Check if Python version is compatible (3.9-3.11)
if [ "$PYTHON_MAJOR" -lt 3 ] || ([ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -lt 9 ]); then
echo "❌ Error: Python 3.9 or higher is required. Found Python $PYTHON_VERSION"
echo "Please upgrade Python to 3.9, 3.10, or 3.11"
exit 1
fi

if [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -gt 11 ]; then
echo "⚠️ Warning: Python 3.12+ detected. Some dependencies may not be compatible."
echo "Consider using Python 3.9-3.11 for best compatibility."
echo "Continuing with installation..."
fi

# Upgrade pip
echo "πŸ“¦ Upgrading pip..."
pip install --upgrade pip setuptools wheel

# Install NumPy first (required for other packages, must be <2.0 for spacy compatibility)
echo "πŸ“¦ Installing NumPy (compatible version)..."
pip install "numpy<2.0"

# Install torch from PyTorch repository (handles version compatibility automatically)
echo "πŸ“¦ Installing PyTorch (CPU version) from PyTorch repository..."
pip install torch --index-url https://download.pytorch.org/whl/cpu

# Install other dependencies from requirements.txt
echo "πŸ“¦ Installing other dependencies..."
pip install -r requirements.txt
pip install streamlit spacy sentence-transformers nltk

echo "Installing spaCy model..."
# Download spaCy model
echo "πŸ“₯ Downloading spaCy model (en_core_web_sm)..."
python -m spacy download en_core_web_sm
python -m nltk.downloader all

# Download NLTK resources
echo "πŸ“₯ Downloading NLTK resources..."
python -c "import nltk; nltk.download('punkt', quiet=True); nltk.download('wordnet', quiet=True); nltk.download('averaged_perceptron_tagger', quiet=True); nltk.download('punkt_tab', quiet=True); nltk.download('averaged_perceptron_tagger_eng', quiet=True)" || {
echo "⚠️ Warning: Some NLTK downloads may have failed, but continuing..."
}

echo "Downloading NLTK data..."
python -c "import nltk; nltk.download('punkt_tab', quiet=True); nltk.download('punkt', quiet=True); nltk.download('wordnet', quiet=True); nltk.download('averaged_perceptron_tagger', quiet=True)"
echo ""
echo "βœ… Installation complete!"
echo ""
echo "πŸš€ To run the app:"
echo " streamlit run main.py"
echo ""