hah don't crash if a user submits an invalid query, better to return empty results. in the future we may want a helpful error message too
This commit is contained in:
parent
4ec9a75293
commit
6be574a0fe
3
serve.py
3
serve.py
@ -118,7 +118,8 @@ def svm_rank(tags: str = '', pid: str = '', svm_c: str = ''):
|
||||
|
||||
# tag can be one tag or a few comma-separated tags or 'all' for all tags we have in db
|
||||
# pid can be a specific paper id to set as positive for a kind of nearest neighbor search
|
||||
assert tags or pid
|
||||
if not (tags or pid):
|
||||
return [], []
|
||||
|
||||
# load all of the features
|
||||
features = load_features()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user