TLeonidas commited on
Commit
4a8503c
1 Parent(s): e67fd9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -4,7 +4,7 @@ import joblib
4
  # Function to load your model (adjust the path and method if needed)
5
  def load_model():
6
  # This path is relative to the root of your Hugging Face Space
7
- model_path = "./random_forest_model_3labels2.joblib"
8
  model = joblib.load(model_path)
9
  return model
10
 
@@ -19,13 +19,12 @@ def predict_hate_speech(text):
19
 
20
  # Adjusted Gradio interface to take text input and output model predictions
21
  iface = gr.Interface(fn=predict_hate_speech,
22
- inputs=gr.inputs.Textbox(lines=2, placeholder="Enter Text Here..."),
23
  outputs="text",
24
- description="Detects hate speech in text. Outputs 'No Hate Speech', 'Offensive Language', or 'Hate Speech'.")
25
  iface.launch()
26
 
27
 
28
-
29
  """
30
  import gradio as gr
31
 
 
4
  # Function to load your model (adjust the path and method if needed)
5
  def load_model():
6
  # This path is relative to the root of your Hugging Face Space
7
+ model_path = "./en-hate-speech-detection-3label"
8
  model = joblib.load(model_path)
9
  return model
10
 
 
19
 
20
  # Adjusted Gradio interface to take text input and output model predictions
21
  iface = gr.Interface(fn=predict_hate_speech,
22
+ inputs=gr.Textbox(lines=2, placeholder="Enter Text Here..."),
23
  outputs="text",
24
+ description="Detects hate speech in text. Outputs 'Neutral or Ambiguous', 'Not Hate', 'Offensive or Hate Speech'.")
25
  iface.launch()
26
 
27
 
 
28
  """
29
  import gradio as gr
30