not-lain commited on
Commit
2374ae7
1 Parent(s): 7c1c90f

commit files to HF hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ __pycache__/deepfakemodel.cpython-39.pyc filter=lfs diff=lfs merge=lfs -text
__pycache__/deepfakemodel.cpython-39.pyc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5bbb956437a3f70cad4bb133c5063b93a9080c4f144a65a83648c7694982e185
3
+ size 872
deepfakeconfig.py CHANGED
@@ -4,7 +4,4 @@ class DeepFakeConfig(PretrainedConfig):
4
  model_type = "ResNet"
5
  def __init__(self,**kwargs):
6
  super().__init__(**kwargs)
7
- self.DEVICE = 'cuda:0' if torch.cuda.is_available() else 'cpu'
8
-
9
- config = DeepFakeConfig()
10
- config.register_for_auto_class()
 
4
  model_type = "ResNet"
5
  def __init__(self,**kwargs):
6
  super().__init__(**kwargs)
7
+ self.DEVICE = 'cuda:0' if torch.cuda.is_available() else 'cpu'
 
 
 
deepfakemodel.py CHANGED
@@ -1,7 +1,6 @@
1
  from transformers import PreTrainedModel
2
  from facenet_pytorch import MTCNN, InceptionResnetV1
3
  from deepfakeconfig import DeepFakeConfig
4
- config = DeepFakeConfig()
5
 
6
  class DeepFakeModel(PreTrainedModel):
7
  config_class = DeepFakeConfig
@@ -12,4 +11,8 @@ class DeepFakeModel(PreTrainedModel):
12
  classify=True,
13
  num_classes=1,
14
  device=config.DEVICE
15
- )
 
 
 
 
 
1
  from transformers import PreTrainedModel
2
  from facenet_pytorch import MTCNN, InceptionResnetV1
3
  from deepfakeconfig import DeepFakeConfig
 
4
 
5
  class DeepFakeModel(PreTrainedModel):
6
  config_class = DeepFakeConfig
 
11
  classify=True,
12
  num_classes=1,
13
  device=config.DEVICE
14
+ )
15
+
16
+
17
+ DeepFakeConfig.register_for_auto_class()
18
+ DeepFakeModel.register_for_auto_class("AutoModelForImageClassification")