Spaces:
Sleeping
Sleeping
Commit
•
6ae3ff9
1
Parent(s):
279f7c4
Update app.py
Browse files
app.py
CHANGED
@@ -5,11 +5,11 @@ from typing import Dict, List, Any
|
|
5 |
import numpy as np
|
6 |
|
7 |
# Load the model and tokenizer
|
8 |
-
model = AutoModelForSequenceClassification.from_pretrained('kietnt0603/
|
9 |
-
tokenizer = AutoTokenizer.from_pretrained('kietnt0603/
|
10 |
|
11 |
# Define the labels
|
12 |
-
labels = ["
|
13 |
|
14 |
# Function for prediction
|
15 |
def predict(inputs: str) -> Dict[str, Any]:
|
@@ -31,8 +31,8 @@ def predict(inputs: str) -> Dict[str, Any]:
|
|
31 |
|
32 |
# Create title and description for the task
|
33 |
title = "Text Classification Demo"
|
34 |
-
description = "Classify text into categories:
|
35 |
-
article = "Model loaded from
|
36 |
|
37 |
# Create the Gradio interface
|
38 |
iface = gr.Interface(fn=predict,
|
|
|
5 |
import numpy as np
|
6 |
|
7 |
# Load the model and tokenizer
|
8 |
+
model = AutoModelForSequenceClassification.from_pretrained('kietnt0603/visobert-vihds')
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained('kietnt0603/visobert-vihds')
|
10 |
|
11 |
# Define the labels
|
12 |
+
labels = ["CLEAN", "OFFENSIVE", "HATE"]
|
13 |
|
14 |
# Function for prediction
|
15 |
def predict(inputs: str) -> Dict[str, Any]:
|
|
|
31 |
|
32 |
# Create title and description for the task
|
33 |
title = "Text Classification Demo"
|
34 |
+
description = "Classify text into categories: CLEAN, OFFENSIVE, HATE"
|
35 |
+
article = "Model loaded from kietnt0603/visobert-vihds"
|
36 |
|
37 |
# Create the Gradio interface
|
38 |
iface = gr.Interface(fn=predict,
|