knight-lee commited on
Commit
11b221c
ยท
verified ยท
1 Parent(s): e2b5a4c

Update dummy_model.py

Browse files
Files changed (1) hide show
  1. dummy_model.py +1 -8
dummy_model.py CHANGED
@@ -11,23 +11,16 @@ class DummyModel(PreTrainedModel):
11
 
12
  def __init__(self, config):
13
  super().__init__(config)
14
- # ์‹ค์ œ weight๋Š” ํ•„์š” ์—†์œผ๋ฏ€๋กœ ๋นˆ ํŒŒ๋ผ๋ฏธํ„ฐ ๋“ฑ๋ก
15
  self.dummy_param = torch.nn.Parameter(torch.empty(0))
16
 
17
  def forward(self, input_ids, **kwargs):
18
- """
19
- forward ํ˜ธ์ถœ ์‹œ ์ž…๋ ฅ ๋ชจ์–‘์— ๋งž์ถฐ ๋ชจ๋‘ 0์ธ logits ๋ฐ˜ํ™˜
20
- """
21
  batch_size, seq_length = input_ids.shape
22
  vocab_size = 50257 # ์˜ˆ์‹œ vocab size
23
  logits = torch.zeros(batch_size, seq_length, vocab_size)
24
  return logits
25
 
26
  def generate(self, input_ids, max_length=20, **kwargs):
27
- """
28
- generate ํ˜ธ์ถœ ์‹œ ๊ณ ์ •๋œ ๋ฌธ์ž์—ด ๋ฐ˜ํ™˜
29
- """
30
  return "This is a dummy output generated by DummyModel."
31
 
32
  # ๋ชจ๋ธ ํƒ€์ž… "dummy"๋ฅผ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.
33
- AutoConfig.register("dummy", DummyConfig)
 
11
 
12
  def __init__(self, config):
13
  super().__init__(config)
 
14
  self.dummy_param = torch.nn.Parameter(torch.empty(0))
15
 
16
  def forward(self, input_ids, **kwargs):
 
 
 
17
  batch_size, seq_length = input_ids.shape
18
  vocab_size = 50257 # ์˜ˆ์‹œ vocab size
19
  logits = torch.zeros(batch_size, seq_length, vocab_size)
20
  return logits
21
 
22
  def generate(self, input_ids, max_length=20, **kwargs):
 
 
 
23
  return "This is a dummy output generated by DummyModel."
24
 
25
  # ๋ชจ๋ธ ํƒ€์ž… "dummy"๋ฅผ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.
26
+ AutoConfig.register("dummy", DummyConfig)