Update app.py
Browse files
app.py
CHANGED
|
@@ -19,14 +19,12 @@ classifier = pipeline(
|
|
| 19 |
|
| 20 |
def predict(user_input: str):
|
| 21 |
|
| 22 |
-
prediction =
|
| 23 |
-
label = prediction['label']
|
| 24 |
-
probability = prediction['score']
|
| 25 |
|
| 26 |
-
return f"
|
| 27 |
|
| 28 |
|
| 29 |
-
textbox = gr.Textbox(placeholder="Enter user input
|
| 30 |
|
| 31 |
interface = gr.Interface(
|
| 32 |
inputs=textbox, fn=predict, outputs="text",
|
|
|
|
| 19 |
|
| 20 |
def predict(user_input: str):
|
| 21 |
|
| 22 |
+
prediction = classifier(user_input)[0]
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
return f"This is likely to be an {prediction['label']} with a probability of {prediction['score']}"
|
| 25 |
|
| 26 |
|
| 27 |
+
textbox = gr.Textbox(placeholder="Enter user input for injection attack classification", lines=12)
|
| 28 |
|
| 29 |
interface = gr.Interface(
|
| 30 |
inputs=textbox, fn=predict, outputs="text",
|