Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def forward(self, input):
"""
This is what is called when the model is forwarded
:param input:
:return:
"""
log.error('You must define a forward method for this model')
pass
i += 1
first_few_lines.append(line)
if i > 0:
break
accepted_delimiters = [',','\t']
dialect = csv.Sniffer().sniff(''.join(first_few_lines[0]), delimiters=accepted_delimiters)
data.seek(0)
# if csv dialect identified then return csv
if dialect:
return data, 'csv', dialect
else:
return data, None, dialect
except:
data.seek(0)
log.error('Could not detect format for this file')
log.error(traceback.format_exc())
# No file type identified
return data, None, dialect
def setup(self, sample_batch, **kwargs):
"""
this is what is called when the model object is instantiated
:param sample_batch:
:param use_cuda:
:return:
"""
log.error('You must define a setup method for this model')
pass
def forward(self, input):
"""
This is what is called when the model is forwarded
:param input:
:return:
"""
log.error('You must define a forward method for this model')
pass
first_few_lines.append(line)
if i > 0:
break
accepted_delimiters = [',','\t']
dialect = csv.Sniffer().sniff(''.join(first_few_lines[0]), delimiters=accepted_delimiters)
data.seek(0)
# if csv dialect identified then return csv
if dialect:
return data, 'csv', dialect
else:
return data, None, dialect
except:
data.seek(0)
log.error('Could not detect format for this file')
log.error(traceback.format_exc())
# No file type identified
return data, None, dialect