upload
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Malte Grosse 2023-11-30 10:09:07 +09:00
parent 511187ba16
commit b84864841a
1 changed files with 13 additions and 1 deletions

14
run.py
View File

@ -1,6 +1,6 @@
import tensorflow as tf import tensorflow as tf
from tensorflow import keras from tensorflow import keras
import requests
import numpy as np import numpy as np
import os import os
# Version Information # Version Information
@ -74,4 +74,16 @@ with tf.device('/GPU:0'):
model.fit(X_train_scaled, y_train_categorical, epochs=10) model.fit(X_train_scaled, y_train_categorical, epochs=10)
model.save('mymodel.keras') model.save('mymodel.keras')
print("finished training")
myurl = 'https://share.storage.sandbox.iuk.hdm-stuttgart.de/upload'
print("uploading file")
files = {
'fileUpload':('mymodel.keras', open('mymodel.keras', 'rb'),'application/octet-stream')
}
response = requests.post(myurl, files=files)
print(response,response.text)
print("done") print("done")