We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dda703a commit f94efe4Copy full SHA for f94efe4
1 file changed
api/resources/llama3.py
@@ -28,17 +28,19 @@ def get(self, gene_id=""):
28
if BARUtils.is_arabidopsis_gene_valid(gene_id):
29
rows = db.session.execute(db.select(Summaries).where(Summaries.gene_id == gene_id)).first()
30
31
- if len(rows) == 0:
32
- return (
33
- BARUtils.error_exit("There are no data found for the given gene"),
34
- 400,
35
- )
36
- else:
+ if rows and len(rows) > 0:
37
res = {
38
"summary": rows[0].summary,
39
"gene_id": rows[0].gene_id,
40
"bert_score": rows[0].bert_score,
41
}
+
42
return BARUtils.success_exit(res)
+ else:
+ return (
+ BARUtils.error_exit("There are no data found for the given gene"),
+ 400,
43
+ )
44
45
else:
46
return BARUtils.error_exit("Invalid gene id"), 400
0 commit comments