Skip to content

Commit f94efe4

Browse files
committed
Updated llama3 endpoint.
1 parent dda703a commit f94efe4

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

api/resources/llama3.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,19 @@ def get(self, gene_id=""):
2828
if BARUtils.is_arabidopsis_gene_valid(gene_id):
2929
rows = db.session.execute(db.select(Summaries).where(Summaries.gene_id == gene_id)).first()
3030

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:
31+
if rows and len(rows) > 0:
3732
res = {
3833
"summary": rows[0].summary,
3934
"gene_id": rows[0].gene_id,
4035
"bert_score": rows[0].bert_score,
4136
}
37+
4238
return BARUtils.success_exit(res)
39+
else:
40+
return (
41+
BARUtils.error_exit("There are no data found for the given gene"),
42+
400,
43+
)
44+
4345
else:
4446
return BARUtils.error_exit("Invalid gene id"), 400

0 commit comments

Comments
 (0)