Spaces:
Running
Running
Nattapong Tapachoom
commited on
Commit
·
20959f5
1
Parent(s):
a2c4342
Add new sentiment model to MODEL_LIST and remove unused pipeline initialization
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
<<<<<<< HEAD
|
5 |
|
6 |
# รายชื่อโมเดลที่ให้เลือก
|
7 |
MODEL_LIST = [
|
@@ -16,7 +15,8 @@ MODEL_LIST = [
|
|
16 |
"ZombitX64/MultiSent-E5-Pro",
|
17 |
"ZombitX64/MultiSent-E5",
|
18 |
"ZombitX64/Thai-sentiment-e5",
|
19 |
-
"ZombitX64/sentiment-103"
|
|
|
20 |
]
|
21 |
|
22 |
from functools import lru_cache
|
@@ -25,10 +25,6 @@ from functools import lru_cache
|
|
25 |
@lru_cache(maxsize=2)
|
26 |
def get_nlp(model_name):
|
27 |
return pipeline("sentiment-analysis", model=model_name)
|
28 |
-
=======
|
29 |
-
model_name = "ZombitX64/Sentiment-03"
|
30 |
-
nlp = pipeline("sentiment-analysis", model=model_name)
|
31 |
-
>>>>>>> 9fff20c2f551dc64f34e70b76c0606f173cd3464
|
32 |
|
33 |
label_map = {
|
34 |
"LABEL_0": 0,
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
|
|
4 |
|
5 |
# รายชื่อโมเดลที่ให้เลือก
|
6 |
MODEL_LIST = [
|
|
|
15 |
"ZombitX64/MultiSent-E5-Pro",
|
16 |
"ZombitX64/MultiSent-E5",
|
17 |
"ZombitX64/Thai-sentiment-e5",
|
18 |
+
"ZombitX64/sentiment-103",
|
19 |
+
"nlptown/bert-base-multilingual-uncased-sentiment"
|
20 |
]
|
21 |
|
22 |
from functools import lru_cache
|
|
|
25 |
@lru_cache(maxsize=2)
|
26 |
def get_nlp(model_name):
|
27 |
return pipeline("sentiment-analysis", model=model_name)
|
|
|
|
|
|
|
|
|
28 |
|
29 |
label_map = {
|
30 |
"LABEL_0": 0,
|