File size: 657 Bytes
dfcf46b
 
bb30cca
 
dfcf46b
bb30cca
 
 
 
 
 
3990405
bb30cca
 
dfcf46b
 
 
 
bb30cca
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)