Commit
·
a42610b
1
Parent(s):
0ac09b2
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from DistilBERT import model_DB
|
2 |
+
import streamlit as st
|
3 |
+
from transformers import AutoTokenizer, AutoModel
|
4 |
+
import torch
|
5 |
+
|
6 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained('distilbert-base-uncased')
|
8 |
+
|
9 |
+
def sentiment_analysis_DB(input):
|
10 |
+
encoded_input = tokenizer(text, return_tensors='pt').to(device)
|
11 |
+
model.to(device)
|
12 |
+
ids =
|
13 |
+
mask =
|
14 |
+
token_type_ids =
|
15 |
+
output =
|