fix
Some checks failed
s434749-training/pipeline/head There was a failure building this commit

This commit is contained in:
Alagris 2021-05-23 19:40:20 +02:00
parent 099bfb8540
commit 1060ec9976
2 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ pipeline {
stages { stages {
stage('Build') { stage('Build') {
steps { steps {
cleanWs()
git 'https://git.wmi.amu.edu.pl/s434749/ium_434749.git' git 'https://git.wmi.amu.edu.pl/s434749/ium_434749.git'
copyArtifacts fingerprintArtifacts: true, projectName: 's434749-create-dataset', selector: lastSuccessful() copyArtifacts fingerprintArtifacts: true, projectName: 's434749-create-dataset', selector: lastSuccessful()
sh "python3 train_model.py with 'batch_size=${params.batch_size}' 'learning_rate=${params.learning_rate}' 'epochs=${params.epochs}'" sh "python3 train_model.py with 'batch_size=${params.batch_size}' 'learning_rate=${params.learning_rate}' 'epochs=${params.epochs}'"

View File

@ -77,7 +77,7 @@ def encode(batch: [(torch.tensor, str)], in_alphabet, max_len):
def encode_str(batch: [(str, str)], in_alphabet, max_len): def encode_str(batch: [(str, str)], in_alphabet, max_len):
batch = [(torch.tensor([in_alphabet[letter] for letter in in_str], dtype=torch.int), out_str) for in_str, out_str in batch] batch = [(torch.tensor([in_alphabet[letter] for letter in in_str], dtype=torch.int), out_str) for in_str, out_str in batch]
return encode(batch) return encode(batch, in_alphabet, max_len)
def train_model(model, learning_rate, in_alphabet, max_len, data, epochs, batch_size): def train_model(model, learning_rate, in_alphabet, max_len, data, epochs, batch_size):