Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
RubensZimbres authored Mar 7, 2021
1 parent 274b4d0 commit 619a7dd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Google-Cloud-Functions-Job/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials

id = 'machinelearning-XXX'
bucket_name = "keras-XXX-folder"
id = 'machinelearning-XXXX'
bucket_name = "keras-ai-XXX"
project_id = 'projects/{}'.format(id)
job_name = "training_" + datetime.datetime.now().strftime("%y%m%d_%H%M%S")

def main(event, context):
#event, context
def main():

training_inputs = {
'scaleTier': 'BASIC',
'packageUris': ["gs://{}/trainer".format(bucket_name)],
'packageUris': ["gs://{}".format(bucket_name)],
'pythonModule': 'trainer.task',
'region': 'us-central1',
'jobDir': "gs://{}".format(bucket_name),
Expand All @@ -23,3 +23,6 @@ def main(event, context):
cloudml = discovery.build("ml" , "v1" ,cache_discovery=False)
request = cloudml.projects().jobs().create(body=job_spec,parent=project_id)
response = request.execute()

#if __name__ == '__main__':
# main()

0 comments on commit 619a7dd

Please sign in to comment.