ElPlaguister commited on
Commit
c4f7946
·
1 Parent(s): 46b206f

Fix KoAlpaca Rollback No Tensor Parallelism

Browse files
Files changed (2) hide show
  1. koalpaca.py +0 -2
  2. requirements.txt +0 -1
koalpaca.py CHANGED
@@ -2,7 +2,6 @@ import torch
2
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, GenerationConfig
3
  from peft import PeftModel, PeftConfig
4
  from model import Model
5
- import tensor_parallel as tp
6
 
7
  class KoAlpaca(Model):
8
  def __init__(self):
@@ -16,7 +15,6 @@ class KoAlpaca(Model):
16
  )
17
  #self.model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, quantization_config=self.bnb_config, device_map={"":0})
18
  self.model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, quantization_config=self.bnb_config, device_map='auto')
19
- self.model = tp.tensor_parallel(self.model, ["cuda:0", "cuda:1"])
20
  self.model = PeftModel.from_pretrained(self.model, peft_model_id)
21
  self.tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
22
  self.gen_config = GenerationConfig.from_pretrained('./models/koalpaca', 'gen_config.json')
 
2
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, GenerationConfig
3
  from peft import PeftModel, PeftConfig
4
  from model import Model
 
5
 
6
  class KoAlpaca(Model):
7
  def __init__(self):
 
15
  )
16
  #self.model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, quantization_config=self.bnb_config, device_map={"":0})
17
  self.model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, quantization_config=self.bnb_config, device_map='auto')
 
18
  self.model = PeftModel.from_pretrained(self.model, peft_model_id)
19
  self.tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
20
  self.gen_config = GenerationConfig.from_pretrained('./models/koalpaca', 'gen_config.json')
requirements.txt CHANGED
@@ -3,5 +3,4 @@ gradio==4.1.1
3
  numpy==1.26.1
4
  pandas==2.1.2
5
  torch==2.0.1
6
- tensor_parallel==2.0.0
7
  git+https://github.com/huggingface/peft.git
 
3
  numpy==1.26.1
4
  pandas==2.1.2
5
  torch==2.0.1
 
6
  git+https://github.com/huggingface/peft.git