Intradiction commited on
Commit
bb30cca
1 Parent(s): 3990405

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -1,9 +1,21 @@
1
  import streamlit as st
2
  from transformers import pipeline
 
 
3
 
 
 
 
 
 
 
4
  pipe = pipeline(model="Intradiction/text_classification_NoLORA")
 
 
5
  text = st.text_area('Input a movie review:')
6
 
7
  if text:
8
  out = pipe(text)
9
- st.json(out)
 
 
 
1
  import streamlit as st
2
  from transformers import pipeline
3
+ from peft import AutoPeftModelForSequenceClassification
4
+ from transformers import AutoTokenizer
5
 
6
+ tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
7
+
8
+ loraModel = AutoPeftModelForSequenceClassification.from_pretrained("Intradiction/text_classification_WithLORA")
9
+
10
+
11
+ # Initialize the two piplelines
12
  pipe = pipeline(model="Intradiction/text_classification_NoLORA")
13
+ LORApipe = pipeline("sentiment-analysis", model=loraModel, tokenizer=tokenizer)
14
+
15
  text = st.text_area('Input a movie review:')
16
 
17
  if text:
18
  out = pipe(text)
19
+ LORAout = LORApipe(text)
20
+ st.json(out)
21
+ st.json(LORAout)