Halfotter commited on
Commit
ff282f7
ยท
verified ยท
1 Parent(s): 6c98b6a

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. regenerate_model.py +28 -0
  2. semantic_model.pkl +3 -0
regenerate_model.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn as nn
3
+ import torch.nn.functional as F
4
+ import pickle
5
+
6
+ # SimpleClassifier ํด๋ž˜์Šค ์ •์˜
7
+ class SimpleClassifier(nn.Module):
8
+ def __init__(self, input_size, num_classes):
9
+ super(SimpleClassifier, self).__init__()
10
+ self.fc1 = nn.Linear(input_size, 256)
11
+ self.fc2 = nn.Linear(256, 128)
12
+ self.fc3 = nn.Linear(128, num_classes)
13
+ self.dropout = nn.Dropout(0.3)
14
+
15
+ def forward(self, x):
16
+ x = F.relu(self.fc1(x))
17
+ x = self.dropout(x)
18
+ x = F.relu(self.fc2(x))
19
+ x = self.dropout(x)
20
+ x = self.fc3(x)
21
+ return x
22
+
23
+ # ๋ชจ๋ธ ํŒŒ์ผ ๋‹ค์‹œ ์ƒ์„ฑ
24
+ with open('semantic_model.pkl', 'rb') as f:
25
+ data = pickle.load(f)
26
+
27
+ torch.save(data['model'].state_dict(), 'pytorch_model.bin')
28
+ print("๋ชจ๋ธ ํŒŒ์ผ ์žฌ์ƒ์„ฑ ์™„๋ฃŒ!")
semantic_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ece66c155962546b7954bc96691a0974d54fa423a3211c112236bc230af39f37
3
+ size 3390141