gilramos commited on
Commit
b4b2d15
1 Parent(s): 816ad81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -17,6 +17,13 @@ app_examples = [
17
  ["O tempo está ensolarado hoje, perfeito para um passeio no parque."]
18
  ]
19
 
 
 
 
 
 
 
 
20
  user_friendly_name = {
21
  "knowhate/HateBERTimbau": "HateBERTimbau (Original)",
22
  "knowhate/HateBERTimbau-youtube": "HateBERTimbau (YouTube)",
@@ -32,11 +39,9 @@ user_friendly_name_list = list(user_friendly_name.values())
32
  #demo.launch()
33
 
34
  def predict(text, chosen_model):
35
-
36
- chosen_model_name = reverse_user_friendly_name[chosen_model]
37
 
38
  # Initialize the pipeline with the chosen model
39
- model_pipeline = pipeline("text-classification", model=chosen_model_name)
40
  result = model_pipeline(text)
41
  label = result[0]['label']
42
 
 
17
  ["O tempo está ensolarado hoje, perfeito para um passeio no parque."]
18
  ]
19
 
20
+ model_list = [
21
+ "knowhate/HateBERTimbau",
22
+ "knowhate/HateBERTimbau-youtube",
23
+ "knowhate/HateBERTimbau-twitter",
24
+ "knowhate/HateBERTimbau-yt-tt",
25
+ ]
26
+
27
  user_friendly_name = {
28
  "knowhate/HateBERTimbau": "HateBERTimbau (Original)",
29
  "knowhate/HateBERTimbau-youtube": "HateBERTimbau (YouTube)",
 
39
  #demo.launch()
40
 
41
  def predict(text, chosen_model):
 
 
42
 
43
  # Initialize the pipeline with the chosen model
44
+ model_pipeline = pipeline("text-classification", model=reverse_user_friendly_name[chosen_model])
45
  result = model_pipeline(text)
46
  label = result[0]['label']
47