niyaa's picture
Update app.py
5e200ff
raw
history blame
606 Bytes
import streamlit as st
from transformers import pipeline
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
tokenizer = AutoTokenizer.from_pretrained("nickmuchi/sec-bert-finetuned-finance-classification")
model = AutoModelForSequenceClassification.from_pretrained("nickmuchi/sec-bert-finetuned-finance-classification")
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, device=device)
text = st.text_area("Enter some text")
if text:
out = pipe(text)
st.json(out)