Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
from spacy import displacy
|
4 |
-
# import torch
|
5 |
|
6 |
# load model pipeline globally
|
7 |
# device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
8 |
ner_pipe = pipeline(task = "ner",
|
9 |
model="cindyangelira/ner-roberta-large-bahasa-indonesia-finetuned",
|
10 |
aggregation_strategy = "simple",
|
11 |
-
device =
|
12 |
|
13 |
# define colors for each tag
|
14 |
def get_colors():
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
from spacy import displacy
|
|
|
4 |
|
5 |
# load model pipeline globally
|
6 |
# device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
7 |
ner_pipe = pipeline(task = "ner",
|
8 |
model="cindyangelira/ner-roberta-large-bahasa-indonesia-finetuned",
|
9 |
aggregation_strategy = "simple",
|
10 |
+
device = "cpu")
|
11 |
|
12 |
# define colors for each tag
|
13 |
def get_colors():
|