Backedman commited on
Commit
b20c5b6
verified
1 Parent(s): 06d1263

Upload model

Browse files
Files changed (3) hide show
  1. QBModelConfig.py +1 -1
  2. QBModelWrapper.py +10 -0
  3. config.json +1 -1
QBModelConfig.py CHANGED
@@ -6,4 +6,4 @@ class QBModelConfig(PretrainedConfig):
6
 
7
  def __init__(self, **kwargs):
8
  super().__init__( **kwargs)
9
- self.torch_dtype = torch.float16
 
6
 
7
  def __init__(self, **kwargs):
8
  super().__init__( **kwargs)
9
+ self.torch_dtype = torch.float32
QBModelWrapper.py CHANGED
@@ -3,10 +3,20 @@ from transformers import PreTrainedModel
3
  from transformers import PretrainedConfig
4
  from QBModelConfig import QBModelConfig
5
  from qbmodel import QuizBowlModel
 
 
 
 
6
 
7
  class QBModelWrapper(PreTrainedModel):
8
  config_class= QBModelConfig
9
  config = QBModelConfig
 
 
 
 
 
 
10
 
11
  def __init__(self, config):
12
  super().__init__(config)
 
3
  from transformers import PretrainedConfig
4
  from QBModelConfig import QBModelConfig
5
  from qbmodel import QuizBowlModel
6
+ from huggingface_hub import hf_hub_download
7
+
8
+ REPO_ID = "Backedman/TriviaAnsweringMachineREAL"
9
+ FILENAME = "models/Mythology_tfidf.pkl"
10
 
11
  class QBModelWrapper(PreTrainedModel):
12
  config_class= QBModelConfig
13
  config = QBModelConfig
14
+
15
+ hf_hub_download(repo_id=REPO_ID, filename='tfidf_model.py', local_dir='')
16
+ hf_hub_download(repo_id=REPO_ID, filename='question_categorizer.py', local_dir='')
17
+ hf_hub_download(repo_id=REPO_ID, filename='models/categorizer', local_dir='')
18
+
19
+
20
 
21
  def __init__(self, config):
22
  super().__init__(config)
config.json CHANGED
@@ -7,6 +7,6 @@
7
  "AutoModelForQuestionAnswering": "QBModelWrapper.QBModelWrapper"
8
  },
9
  "model_type": "TFIDF-QA",
10
- "torch_dtype": "float16",
11
  "transformers_version": "4.40.1"
12
  }
 
7
  "AutoModelForQuestionAnswering": "QBModelWrapper.QBModelWrapper"
8
  },
9
  "model_type": "TFIDF-QA",
10
+ "torch_dtype": "float32",
11
  "transformers_version": "4.40.1"
12
  }