Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

base.py 419 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  1. import abc
  2. from torch import nn
  3. class ModelBase(nn.Module):
  4. @abc.abstractmethod
  5. def init_weights(self):
  6. raise NotImplemented
  7. @abc.abstractmethod
  8. def forward(self, text, offsets):
  9. raise NotImplemented
  10. @abc.abstractmethod
  11. def load_model(self, model_path):
  12. raise NotImplemented
  13. @abc.abstractmethod
  14. def save_model(self, model_path):
  15. raise NotImplemented
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...