ElPlaguister commited on
Commit
d753197
Β·
1 Parent(s): 47eae50

Fix Model Parameter Init

Browse files
Files changed (3) hide show
  1. koalpaca.py +2 -0
  2. model.py +0 -4
  3. t5.py +2 -0
koalpaca.py CHANGED
@@ -23,6 +23,8 @@ class KoAlpaca(Model):
23
  self.INPUT_FORMAT = "### 질문: <INPUT>\n\n### λ‹΅λ³€:"
24
  self.model.eval()
25
 
 
 
26
  def generate(self, inputs):
27
  inputs = self.INPUT_FORMAT.replace('<INPUT>', inputs)
28
  output_ids = self.model.generate(
 
23
  self.INPUT_FORMAT = "### 질문: <INPUT>\n\n### λ‹΅λ³€:"
24
  self.model.eval()
25
 
26
+ super().__init__()
27
+
28
  def generate(self, inputs):
29
  inputs = self.INPUT_FORMAT.replace('<INPUT>', inputs)
30
  output_ids = self.model.generate(
model.py CHANGED
@@ -5,10 +5,6 @@ class Model:
5
  placeholder:str="Input"):
6
  self.name = name
7
  self.placeholder = placeholder
8
- self.model = None
9
- self.tokenizer = None
10
- self.gen_config = None
11
- self.INPUT_FORMAT = None
12
  self.SPETIAL_TOKENS = ["#ν™”μž#", "#청자#", "#(λ‚¨μž)청자#", "#(λ‚¨μž)ν™”μž#", "#(μ—¬μž)청자#", "(μ—¬μž)ν™”μž"]
13
 
14
  def generate(self, inputs:str) -> str:
 
5
  placeholder:str="Input"):
6
  self.name = name
7
  self.placeholder = placeholder
 
 
 
 
8
  self.SPETIAL_TOKENS = ["#ν™”μž#", "#청자#", "#(λ‚¨μž)청자#", "#(λ‚¨μž)ν™”μž#", "#(μ—¬μž)청자#", "(μ—¬μž)ν™”μž"]
9
 
10
  def generate(self, inputs:str) -> str:
t5.py CHANGED
@@ -21,6 +21,8 @@ class T5(Model):
21
  self.model.resize_token_embeddings(len(self.tokenizer))
22
  self.model.config.max_length = max_target_length
23
  self.tokenizer.model_max_length = max_target_length
 
 
24
 
25
  def generate(self, inputs):
26
  inputs = self.INPUT_FORMAT.replace("<INPUT>", inputs)
 
21
  self.model.resize_token_embeddings(len(self.tokenizer))
22
  self.model.config.max_length = max_target_length
23
  self.tokenizer.model_max_length = max_target_length
24
+
25
+ super().__init__()
26
 
27
  def generate(self, inputs):
28
  inputs = self.INPUT_FORMAT.replace("<INPUT>", inputs)