Tatiana commited on
Commit
aa3e28c
1 Parent(s): 0d3411a

files added

Browse files
Files changed (2) hide show
  1. task2.py +2 -2
  2. task3.py +1 -1
task2.py CHANGED
@@ -3,8 +3,8 @@ import torch
3
  from sklearn.preprocessing import LabelEncoder
4
 
5
  #Загрузка сохраненной модели и токенизатора в Streamlit
6
- loaded_model_path = "/home/tata/DS_bootcamp/ds-phase-2/10-nlp/project4/model"
7
- loaded_tokenizer_path = "/home/tata/DS_bootcamp/ds-phase-2/10-nlp/project4/tokenizer"
8
 
9
  loaded_model = BertForSequenceClassification.from_pretrained(loaded_model_path)
10
  loaded_tokenizer = BertTokenizer.from_pretrained(loaded_tokenizer_path)
 
3
  from sklearn.preprocessing import LabelEncoder
4
 
5
  #Загрузка сохраненной модели и токенизатора в Streamlit
6
+ loaded_model_path = "nlp_project/model"
7
+ loaded_tokenizer_path = "nlp_project/tokenizer"
8
 
9
  loaded_model = BertForSequenceClassification.from_pretrained(loaded_model_path)
10
  loaded_tokenizer = BertTokenizer.from_pretrained(loaded_tokenizer_path)
task3.py CHANGED
@@ -12,7 +12,7 @@ model = GPT2LMHeadModel.from_pretrained(
12
  )
13
 
14
  # Загрузка сохраненных весов
15
- model_weights_path = "/home/tata/DS_bootcamp/ds-phase-2/10-nlp/project4/hunter_generator.pt"
16
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
17
  model.load_state_dict(torch.load(model_weights_path, map_location=device))
18
  model.eval()
 
12
  )
13
 
14
  # Загрузка сохраненных весов
15
+ model_weights_path = "nlp_project/hunter_generator.pt"
16
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
17
  model.load_state_dict(torch.load(model_weights_path, map_location=device))
18
  model.eval()