Reputation: 76
I've followed these instructions from here to get my data being read from a google storage bucket by the google ML engine. - https://cloud.google.com/ml-engine/docs/how-tos/working-with-data
But cannot seem to get my code to read from the bucket after assigning the permissions to my project as per the instructions above..
This is what the code looks like, the error showing up is that the files are unable to be found
def get_model():
global MODEL
if MODEL is None:
MODEL = kenlm.Model('gs://deepspeech/data/lm/lm.binary')
return MODEL
def words(text):
"List of words in text."
return re.findall(r'\w+', text.lower())
# Load known word set
with open('gs://deepspeech/spell/words.txt') as f:
WORDS = set(words(f.read()))
Upvotes: 0
Views: 438
Reputation: 8389
You cannot use open
for files on GCS. See this answer for more details.
Upvotes: 1