Skip to content

Commit 3a9f2ba

Browse files
Add support for specified model version
2 parents 1f0022b + d0c5a09 commit 3a9f2ba

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def readme():
88
return f.read()
99

1010
setuptools.setup(name='unmand',
11-
version='2.0.1',
11+
version='2.1.0',
1212
description='Helper library for consuming the Unmand API',
1313
url='https://github.com/unmand-systems/unmand-python',
1414
author='Josiah Khor',

src/unmand/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,19 @@ def __init__(self, token, test=False):
107107
def queue(self, file_data, guid=None):
108108
"""Submit a document for prediction"""
109109
files = {"file": file_data}
110+
payload = {
111+
'source': 'API',
112+
}
110113

111114
if guid:
112-
logging.error('Model version selection not supported. Defaulting to the ACTIVE model version.')
115+
logging.info('Using specified model version')
116+
payload['model'] = guid
113117

114118
result = requests.post(
115119
f'{self.url}projects/extractions',
116120
files=files,
117-
auth=TokenAuth(self.token)
121+
auth=TokenAuth(self.token),
122+
data=payload
118123
)
119124

120125
if result.status_code == requests.codes.created: # pylint: disable=no-member

0 commit comments

Comments
 (0)