youl commited on
Commit
ecf4473
·
verified ·
1 Parent(s): a0fadba
Files changed (1) hide show
  1. utils.py +4 -3
utils.py CHANGED
@@ -8,14 +8,15 @@ from PIL import Image
8
  import albumentations as A
9
  from albumentations.pytorch import ToTensorV2
10
  import tempfile
 
11
 
12
  def getcredentials():
13
  secret_key_credential = os.getenv("cloud_vision")
14
 
15
  with tempfile.NamedTemporaryFile(mode='w+', delete= True, suffix=".json") as temp_file:
16
- json_file = temp_file.write(secret_key_credential)
17
-
18
- tempfile_name = json_file.name
19
 
20
  return tempfile_name
21
  ##
 
8
  import albumentations as A
9
  from albumentations.pytorch import ToTensorV2
10
  import tempfile
11
+ import json
12
 
13
  def getcredentials():
14
  secret_key_credential = os.getenv("cloud_vision")
15
 
16
  with tempfile.NamedTemporaryFile(mode='w+', delete= True, suffix=".json") as temp_file:
17
+ temp_file.write(json.dumps(secret_key_credential))
18
+
19
+ tempfile_name = temp_file.name
20
 
21
  return tempfile_name
22
  ##