ubden commited on
Commit
b96e1f4
·
verified ·
1 Parent(s): 7464567

Upload 15 files

Browse files
Files changed (3) hide show
  1. deployment_guide.md +4 -5
  2. handler.py +9 -5
  3. requirements.txt +6 -7
deployment_guide.md CHANGED
@@ -14,13 +14,12 @@
14
  pip install -r requirements.txt
15
  ```
16
 
17
- 2. **LLaVA Architecture Desteği (PULSE-7B için kritik):**
18
  ```bash
19
- # Eğer "llava_llama architecture not recognized" hatası alırsanız:
20
- pip install --upgrade transformers
21
 
22
- # Veya en son development sürümü:
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
- # Check if it's a development version
53
- if "dev" in transformers.__version__ or "git" in str(transformers.__version__):
54
- print("✅ Using development version - llava_llama support expected")
 
 
55
  else:
56
- print("⚠️ Using stable version - llava_llama support may not be available")
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("💡 Installing PULSE LLaVA dependencies...")
 
 
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
- # Core ML dependencies - PULSE-7B requires development transformers for llava_llama architecture
2
- # Note: Stable transformers doesn't support llava_llama yet, using development version
3
- git+https://github.com/huggingface/transformers.git
 
 
 
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"