0xrizzler commited on
Commit
677039b
·
verified ·
1 Parent(s): b8dfdaa

create app.py file with main code.

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ task = st.selectbox("Choose a task", ["Text generation", "Summarization"])
5
+
6
+ if task == "Text generation":
7
+ model = pipeline("text-generation")
8
+ else:
9
+ model = pipeline("summarization")
10
+
11
+ prompt = st.text_area("Enter a prompt")
12
+
13
+ if prompt:
14
+ output = model(prompt)[0]["generated_text"]
15
+ st.write(output)