scdrand23 commited on
Commit
ed8aeee
·
1 Parent(s): ca50e59

major change, used biomed_llama 7b

Browse files
Files changed (2) hide show
  1. app.py +8 -1
  2. requirements.txt +5 -3
app.py CHANGED
@@ -192,12 +192,19 @@ def initialize_model():
192
  def initialize_llm():
193
  try:
194
  print("Starting LLM initialization...")
 
 
 
 
 
 
195
  model = AutoModel.from_pretrained(
196
  "ContactDoctor/Bio-Medical-MultiModal-Llama-3-8B-V1",
197
  device_map="auto",
198
  torch_dtype=torch.float16,
199
  trust_remote_code=True,
200
- low_cpu_mem_usage=True
 
201
  )
202
  print("Model loaded successfully")
203
 
 
192
  def initialize_llm():
193
  try:
194
  print("Starting LLM initialization...")
195
+ # Add quantization config
196
+ quantization_config = BitsAndBytesConfig(
197
+ load_in_4bit=True,
198
+ bnb_4bit_compute_dtype=torch.float16
199
+ )
200
+
201
  model = AutoModel.from_pretrained(
202
  "ContactDoctor/Bio-Medical-MultiModal-Llama-3-8B-V1",
203
  device_map="auto",
204
  torch_dtype=torch.float16,
205
  trust_remote_code=True,
206
+ low_cpu_mem_usage=True,
207
+ quantization_config=quantization_config
208
  )
209
  print("Model loaded successfully")
210
 
requirements.txt CHANGED
@@ -11,8 +11,8 @@ timm==0.4.12
11
  numpy==1.26.4
12
  einops==0.8.0
13
  fvcore==0.1.5.post20221221
14
- transformers==4.34.0
15
- sentencepiece==0.1.99
16
  ftfy==6.1.1
17
  regex==2023.10.3
18
  nltk==3.8.1
@@ -25,7 +25,8 @@ pycocotools==2.0.7
25
  diffdist==0.1
26
  scikit-image==0.21.0
27
  mup==1.0.0
28
- accelerate==0.23.0
 
29
  kornia==0.7.0
30
  infinibatch==0.1.1
31
  open-clip-torch==2.26.1
@@ -55,6 +56,7 @@ tokenizers==0.14.1
55
  #
56
  # torch>=2.0.0
57
  # transformers>=4.34.0
 
58
  # gradio>=4.40.0
59
  # Pillow>=9.0.0
60
  # numpy>=1.21.0
 
11
  numpy==1.26.4
12
  einops==0.8.0
13
  fvcore==0.1.5.post20221221
14
+ # transformers==4.34.0
15
+ sentencepiece
16
  ftfy==6.1.1
17
  regex==2023.10.3
18
  nltk==3.8.1
 
25
  diffdist==0.1
26
  scikit-image==0.21.0
27
  mup==1.0.0
28
+ accelerate
29
+ bitsandbytes
30
  kornia==0.7.0
31
  infinibatch==0.1.1
32
  open-clip-torch==2.26.1
 
56
  #
57
  # torch>=2.0.0
58
  # transformers>=4.34.0
59
+ transformers==4.36.0
60
  # gradio>=4.40.0
61
  # Pillow>=9.0.0
62
  # numpy>=1.21.0