homer-meng commited on
Commit
de9701e
·
1 Parent(s): 4c6f373

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -1,17 +1,10 @@
1
  import streamlit as st
2
- import torch
3
- from transformers import AutoTokenizer, GPTNeoForCausalLM
4
- from PIL import Image
5
- import io
6
 
7
- tokenizer = AutoTokenizer.from_pretrained("runwayml/stable-diffusion-v1-5")
8
- model = GPTNeoForCausalLM.from_pretrained("runwayml/stable-diffusion-v1-5")
9
 
10
- st.title("Scribble Drawing Generator")
11
 
12
- prompt = st.text_input("Enter a prompt:")
13
- if prompt:
14
- inputs = tokenizer(prompt, return_tensors="pt")
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)