Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,13 +3,12 @@ import re
|
|
| 3 |
|
| 4 |
import pip
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
def install(package):
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
else:
|
| 10 |
-
pip._internal.main(['install', package])
|
| 11 |
-
if __name__ == '__main__':
|
| 12 |
-
install('transformers')
|
| 13 |
|
| 14 |
from transformers import pipeline
|
| 15 |
|
|
@@ -28,7 +27,7 @@ def bullying_analysis(language, text):
|
|
| 28 |
|
| 29 |
gradio_ui = gr.Interface(
|
| 30 |
fn=bullying_analysis,
|
| 31 |
-
title="CyberBullying Detector (
|
| 32 |
description="Enter some text and check if the model detects bullying.",
|
| 33 |
inputs=[
|
| 34 |
gr.inputs.Radio(['Spanish','Catalan'],label='Language',),
|
|
|
|
| 3 |
|
| 4 |
import pip
|
| 5 |
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
|
| 9 |
def install(package):
|
| 10 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
| 11 |
+
install('transformers')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
from transformers import pipeline
|
| 14 |
|
|
|
|
| 27 |
|
| 28 |
gradio_ui = gr.Interface(
|
| 29 |
fn=bullying_analysis,
|
| 30 |
+
title="CyberBullying Detector ()",
|
| 31 |
description="Enter some text and check if the model detects bullying.",
|
| 32 |
inputs=[
|
| 33 |
gr.inputs.Radio(['Spanish','Catalan'],label='Language',),
|