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:
@@ -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
|
# 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
|
# 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
|
# load all of the features
|
||||||
features = load_features()
|
features = load_features()
|
||||||
|
|||||||
Reference in New Issue
Block a user