gilramos commited on
Commit
e31ea1f
1 Parent(s): 17ee3d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -17,13 +17,6 @@ app_examples = [
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)",
@@ -38,8 +31,10 @@ user_friendly_name_list = list(user_friendly_name.values())
38
  #demo = gr.Interface.from_pipeline(pipe)
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=chosen_model)
45
  result = model_pipeline(text)
 
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)",
 
31
  #demo = gr.Interface.from_pipeline(pipe)
32
  #demo.launch()
33
 
34
+ def predict(text, chosen_model_name):
35
 
36
+ chosen_model = reverse_user_friendly_name[chosen_model_name]
37
+
38
  # Initialize the pipeline with the chosen model
39
  model_pipeline = pipeline("text-classification", model=chosen_model)
40
  result = model_pipeline(text)