test1 / app.py
Intradiction's picture
Update app.py
bb30cca
raw
history blame contribute delete
657 Bytes
import streamlit as st
from transformers import pipeline
from peft import AutoPeftModelForSequenceClassification
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
loraModel = AutoPeftModelForSequenceClassification.from_pretrained("Intradiction/text_classification_WithLORA")
# Initialize the two piplelines
pipe = pipeline(model="Intradiction/text_classification_NoLORA")
LORApipe = pipeline("sentiment-analysis", model=loraModel, tokenizer=tokenizer)
text = st.text_area('Input a movie review:')
if text:
out = pipe(text)
LORAout = LORApipe(text)
st.json(out)
st.json(LORAout)