Upload 15 files
Browse files- deployment_guide.md +4 -5
- handler.py +9 -5
- requirements.txt +6 -7
deployment_guide.md
CHANGED
|
@@ -14,13 +14,12 @@
|
|
| 14 |
pip install -r requirements.txt
|
| 15 |
```
|
| 16 |
|
| 17 |
-
2. **LLaVA
|
| 18 |
```bash
|
| 19 |
-
#
|
| 20 |
-
pip install
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
pip install git+https://github.com/huggingface/transformers.git
|
| 24 |
```
|
| 25 |
|
| 26 |
3. **Flash Attention (isteğe bağlı, performans için):**
|
|
|
|
| 14 |
pip install -r requirements.txt
|
| 15 |
```
|
| 16 |
|
| 17 |
+
2. **PULSE LLaVA Installation (PULSE-7B için kritik):**
|
| 18 |
```bash
|
| 19 |
+
# PULSE-7B için PULSE'un kendi LLaVA implementasyonu gerekli:
|
| 20 |
+
pip install git+https://github.com/AIMedLab/PULSE.git#subdirectory=LLaVA
|
| 21 |
|
| 22 |
+
# Bu otomatik olarak transformers==4.37.2 yükleyecektir
|
|
|
|
| 23 |
```
|
| 24 |
|
| 25 |
3. **Flash Attention (isteğe bağlı, performans için):**
|
handler.py
CHANGED
|
@@ -49,11 +49,13 @@ class EndpointHandler:
|
|
| 49 |
import transformers
|
| 50 |
print(f"🔧 Transformers version: {transformers.__version__}")
|
| 51 |
|
| 52 |
-
#
|
| 53 |
-
if
|
| 54 |
-
print("✅ Using
|
|
|
|
|
|
|
| 55 |
else:
|
| 56 |
-
print("⚠️ Using
|
| 57 |
except Exception as e:
|
| 58 |
print(f"❌ Error checking transformers version: {e}")
|
| 59 |
|
|
@@ -101,7 +103,9 @@ class EndpointHandler:
|
|
| 101 |
|
| 102 |
except ImportError as import_error:
|
| 103 |
print(f"⚠️ PULSE LLaVA modules not available: {import_error}")
|
| 104 |
-
print("💡
|
|
|
|
|
|
|
| 105 |
|
| 106 |
# Fallback to transformers approach
|
| 107 |
from transformers import AutoModel, AutoProcessor
|
|
|
|
| 49 |
import transformers
|
| 50 |
print(f"🔧 Transformers version: {transformers.__version__}")
|
| 51 |
|
| 52 |
+
# PULSE LLaVA works with transformers==4.37.2
|
| 53 |
+
if transformers.__version__ == "4.37.2":
|
| 54 |
+
print("✅ Using PULSE LLaVA compatible version (4.37.2)")
|
| 55 |
+
elif "dev" in transformers.__version__ or "git" in str(transformers.__version__):
|
| 56 |
+
print("⚠️ Using development version - may conflict with PULSE LLaVA")
|
| 57 |
else:
|
| 58 |
+
print("⚠️ Using different version - PULSE LLaVA prefers 4.37.2")
|
| 59 |
except Exception as e:
|
| 60 |
print(f"❌ Error checking transformers version: {e}")
|
| 61 |
|
|
|
|
| 103 |
|
| 104 |
except ImportError as import_error:
|
| 105 |
print(f"⚠️ PULSE LLaVA modules not available: {import_error}")
|
| 106 |
+
print("💡 PULSE LLaVA not installed correctly!")
|
| 107 |
+
print("📋 Required: pip install git+https://github.com/AIMedLab/PULSE.git#subdirectory=LLaVA")
|
| 108 |
+
print("🔄 Falling back to transformers approach...")
|
| 109 |
|
| 110 |
# Fallback to transformers approach
|
| 111 |
from transformers import AutoModel, AutoProcessor
|
requirements.txt
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
-
#
|
| 2 |
-
#
|
| 3 |
-
git+https://github.com/
|
|
|
|
|
|
|
|
|
|
| 4 |
torch>=2.1.0
|
| 5 |
accelerate>=0.25.0
|
| 6 |
sentencepiece
|
|
@@ -14,10 +17,6 @@ requests>=2.28.0
|
|
| 14 |
# LLaVA/Vision model dependencies
|
| 15 |
timm>=0.9.0
|
| 16 |
|
| 17 |
-
# PULSE-7B specific dependencies (LLaVA implementation)
|
| 18 |
-
# Install PULSE's LLaVA implementation for proper model loading
|
| 19 |
-
git+https://github.com/AIMedLab/PULSE.git#subdirectory=LLaVA
|
| 20 |
-
|
| 21 |
# Optional performance improvements
|
| 22 |
flash-attn>=2.0.0; sys_platform != "darwin"
|
| 23 |
bitsandbytes>=0.41.0; sys_platform != "darwin"
|
|
|
|
| 1 |
+
# PULSE-7B specific dependencies (LLaVA implementation)
|
| 2 |
+
# Install PULSE's LLaVA implementation for proper model loading
|
| 3 |
+
git+https://github.com/AIMedLab/PULSE.git#subdirectory=LLaVA
|
| 4 |
+
|
| 5 |
+
# Core ML dependencies - Use PULSE LLaVA's required transformers version
|
| 6 |
+
# Note: PULSE LLaVA requires transformers==4.37.2, not development version
|
| 7 |
torch>=2.1.0
|
| 8 |
accelerate>=0.25.0
|
| 9 |
sentencepiece
|
|
|
|
| 17 |
# LLaVA/Vision model dependencies
|
| 18 |
timm>=0.9.0
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Optional performance improvements
|
| 21 |
flash-attn>=2.0.0; sys_platform != "darwin"
|
| 22 |
bitsandbytes>=0.41.0; sys_platform != "darwin"
|