EveSa commited on
Commit
3775b84
1 Parent(s): 4cbd001

ajout de vocab.pkl et remove de model

Browse files
Files changed (3) hide show
  1. .gitattributes +0 -1
  2. src/inference.py +3 -5
  3. src/train.py +1 -1
.gitattributes CHANGED
@@ -1,2 +1 @@
1
  *.pt filter=lfs diff=lfs merge=lfs -text
2
- *.pkl filter=lfs diff=lfs merge=lfs -text
 
1
  *.pt filter=lfs diff=lfs merge=lfs -text
 
src/inference.py CHANGED
@@ -34,13 +34,11 @@ def inferenceAPI(text: str) -> str:
34
  decoder.to(device)
35
 
36
  # On instancie le modèle
37
- model = AutoModel.from_pretrained("EveSa/SummaryProject-LSTM", revision="main")
38
- model = AutoModel.PretrainedConfig()
39
  model = EncoderDecoderModel(encoder, decoder, vectoriser, device)
40
 
41
- model.load_state_dict(torch.load("model/model.pt", map_location=device))
42
- model.eval()
43
- model.to(device)
44
 
45
  # On vectorise le texte
46
  source = vectoriser.encode(text)
 
34
  decoder.to(device)
35
 
36
  # On instancie le modèle
 
 
37
  model = EncoderDecoderModel(encoder, decoder, vectoriser, device)
38
 
39
+ # model.load_state_dict(torch.load("model/model.pt", map_location=device))
40
+ # model.eval()
41
+ # model.to(device)
42
 
43
  # On vectorise le texte
44
  source = vectoriser.encode(text)
src/train.py CHANGED
@@ -194,7 +194,7 @@ if __name__ == "__main__":
194
 
195
  torch.save(trained_classifier.state_dict(), "model/model.pt")
196
  vectoriser.save("model/vocab.pkl")
197
- trained_classifier.config.to_json_file("config.json")
198
 
199
  print(f"test summary : {vectoriser.decode(dev_dataset[6][1])}")
200
  print(
 
194
 
195
  torch.save(trained_classifier.state_dict(), "model/model.pt")
196
  vectoriser.save("model/vocab.pkl")
197
+ trained_classifier.push_to_hub("SummaryProject-LSTM")
198
 
199
  print(f"test summary : {vectoriser.decode(dev_dataset[6][1])}")
200
  print(