Dusan commited on
Commit
4603d42
1 Parent(s): c8b0059

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -81,8 +81,11 @@ def preprocess_function_title_only_classification(examples,tokenizer=None):
81
 
82
  input_example = "On Friday, a clip of Los Angeles Lakers star LeBron James from the latest episode of \"The Shop: Uninterrupted\" is going viral on Twitter. \"Cause they racist as f--k,\" James said when asked why he hates Boston. James has had many battles with the Boston Celtics in the NBA Playoffs. According to StatMuse, he has played the Celtics 41 times in the NBA Playoffs. He's played them in the playoffs when he was on the Cleveland Cavaliers (the first time), the Miami Heat and the Cavs (the second time). Therefore, he has had quite the experience facing off with them in hostile environments. He is 25-16 against them in the 41 playoff games and averaged 29.6 points per game. (also according to StatMuse). James is currently on the Los Angeles Lakers, and the team missed the postseason this past year. They were the 11th seed in the Western Conference, so they also missed the play-in tournament which was a big surprise. His first year in Los Angeles, they also missed the playoffs, but the following season he led them to their first NBA Championship since the 2010 season. In 2021, they lost in the first-round, so they have been on a downward trajectory since winning the title. Next season will be his 20th season in the NBA, and he is widely regarded as one of the top-five (and to some the greatest) player ever to play the game of basketball. He is 37-years-old, and was the first overall pick out of high school in the 2003 NBA Draft. "
83
 
84
- textbox = gr.inputs.Textbox(preprocessing_fn=preprocessing,
85
- sample_inputs=[input_example])
 
 
 
86
 
87
 
88
  def clickbait_generator(article_content, condition_lambda=5.0):
@@ -113,8 +116,8 @@ app = gr.Interface(
113
  description = description,
114
  label = 'Article content or paragraph',
115
  fn = clickbait_generator,
116
- inputs=[textbox, gr.Slider(0, 15, step=0.1, value=5.0)],
117
- outputs="text",
118
  article=article,
119
  )
120
  app.launch()
 
81
 
82
  input_example = "On Friday, a clip of Los Angeles Lakers star LeBron James from the latest episode of \"The Shop: Uninterrupted\" is going viral on Twitter. \"Cause they racist as f--k,\" James said when asked why he hates Boston. James has had many battles with the Boston Celtics in the NBA Playoffs. According to StatMuse, he has played the Celtics 41 times in the NBA Playoffs. He's played them in the playoffs when he was on the Cleveland Cavaliers (the first time), the Miami Heat and the Cavs (the second time). Therefore, he has had quite the experience facing off with them in hostile environments. He is 25-16 against them in the 41 playoff games and averaged 29.6 points per game. (also according to StatMuse). James is currently on the Los Angeles Lakers, and the team missed the postseason this past year. They were the 11th seed in the Western Conference, so they also missed the play-in tournament which was a big surprise. His first year in Los Angeles, they also missed the playoffs, but the following season he led them to their first NBA Championship since the 2010 season. In 2021, they lost in the first-round, so they have been on a downward trajectory since winning the title. Next season will be his 20th season in the NBA, and he is widely regarded as one of the top-five (and to some the greatest) player ever to play the game of basketball. He is 37-years-old, and was the first overall pick out of high school in the 2003 NBA Draft. "
83
 
84
+ output_example = "Here's why Lebron James hates the Celtics"
85
+ textbox_input = gr.inputs.Textbox(label = "Article content",
86
+ value=input_example)
87
+ textbox_output = gr.inputs.Textbox(label = "Output clickbait title",
88
+ value=input_example)
89
 
90
 
91
  def clickbait_generator(article_content, condition_lambda=5.0):
 
116
  description = description,
117
  label = 'Article content or paragraph',
118
  fn = clickbait_generator,
119
+ inputs=[textbox_input, gr.Slider(0, 15, step=0.1, value=5.0)],
120
+ outputs=textbox_output,
121
  article=article,
122
  )
123
  app.launch()