lmastm commited on
Commit
acc6e12
·
verified ·
1 Parent(s): fe80e66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,9 +1,10 @@
1
  import streamlit as st
2
  from transformers import pipeline
 
3
 
4
- pipe = pipeline('sentiment-analysis')
5
  text = st.text_area("Enter a sentence !")
6
 
7
  if text:
8
- out = pipe(text)
9
  st.json(out)
 
1
  import streamlit as st
2
  from transformers import pipeline
3
+ import torch
4
 
5
+ pipe = pipeline(model="facebook/opt-1.3b", torch_dtype=torch.bfloat16, device_map="auto")
6
  text = st.text_area("Enter a sentence !")
7
 
8
  if text:
9
+ out = pipe(text, do_sample=True, top_p=0.95)
10
  st.json(out)