Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
|
|
|
| 3 |
|
| 4 |
-
pipe = pipeline(
|
| 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)
|