Spaces:
Runtime error
Runtime error
Commit
·
de9701e
1
Parent(s):
4c6f373
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,10 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import
|
| 3 |
-
from transformers import AutoTokenizer, GPTNeoForCausalLM
|
| 4 |
-
from PIL import Image
|
| 5 |
-
import io
|
| 6 |
|
| 7 |
-
|
| 8 |
-
model = GPTNeoForCausalLM.from_pretrained("runwayml/stable-diffusion-v1-5")
|
| 9 |
|
| 10 |
-
st.
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
outputs = model.generate(inputs['input_ids'], max_length=256, do_sample=True)
|
| 16 |
-
image = Image.open(io.BytesIO(outputs[0].cpu().numpy()))
|
| 17 |
-
st.image(image, caption="Generated Drawing")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformer import pipeline
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
pipe = pipeline('sentiment-analysis')
|
|
|
|
| 5 |
|
| 6 |
+
text =st.text area('enter some text!')
|
| 7 |
|
| 8 |
+
if text:
|
| 9 |
+
out = pipe(text)
|
| 10 |
+
st.json(out)
|
|
|
|
|
|
|
|
|