sks01dev commited on
Commit
bf7fdad
·
1 Parent(s): 1f5dc83

Production Deploy: Final minimal app and configuration.

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
4
 
5
  CLASSIFIER_MODEL_ID = "sks01dev/clickbait-classifier"
6
 
7
- # The pipeline loads assets directly from the Hub and handles pre/post-processing.
8
  classifier = pipeline(
9
  "sentiment-analysis",
10
  model=CLASSIFIER_MODEL_ID,
@@ -13,9 +13,8 @@ classifier = pipeline(
13
  )
14
 
15
  def predict(headline):
16
- # Runs inference and formats the output dictionary for Gradio Label
17
  results = classifier(headline)[0]
18
-
19
  formatted_output = {
20
  "NOT CLICKBAIT (0)": results[0]['score'],
21
  "CLICKBAIT (1)": results[1]['score']
@@ -31,7 +30,7 @@ gr.Interface(
31
  description="DeBERTa-v3-small model deployed for high-confidence headline analysis.",
32
  examples=[
33
  ["10 Ways To Instantly Improve Your Mood"],
34
- ["Government Releases New Economic Policy Report"],
35
  ["You Won't Believe What Happened When We Tested This!"],
36
  ]
37
  ).launch()
 
4
 
5
  CLASSIFIER_MODEL_ID = "sks01dev/clickbait-classifier"
6
 
7
+ # Load model assets directly from the Hub
8
  classifier = pipeline(
9
  "sentiment-analysis",
10
  model=CLASSIFIER_MODEL_ID,
 
13
  )
14
 
15
  def predict(headline):
 
16
  results = classifier(headline)[0]
17
+ # Format output for clear confidence display
18
  formatted_output = {
19
  "NOT CLICKBAIT (0)": results[0]['score'],
20
  "CLICKBAIT (1)": results[1]['score']
 
30
  description="DeBERTa-v3-small model deployed for high-confidence headline analysis.",
31
  examples=[
32
  ["10 Ways To Instantly Improve Your Mood"],
33
+ ["You Won't Believe What Happened When We Tested This!"],
34
  ["You Won't Believe What Happened When We Tested This!"],
35
  ]
36
  ).launch()