Skip to content

Commit

Permalink
fix: Disable predictions if model is absent (#7520)
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavrajs committed Jul 13, 2023
1 parent 50a927b commit 7e415fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions enterprise/app/jobs/enterprise/sentiment_analysis_job.rb
Expand Up @@ -17,6 +17,8 @@ def save_message_sentiment(message)
# While gathering the maningfull node the Array/tensor index is going out of bound

text = message.content&.truncate(2900)
return if model.blank?

sentiment = model.predict(text)
message.sentiment = sentiment.merge(value: label_val(sentiment))

Expand Down

0 comments on commit 7e415fb

Please sign in to comment.