jcarbonnell commited on
Commit
fccc3c5
·
1 Parent(s): ecd776b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,8 +1,8 @@
1
  import streamlit as st
2
- from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
3
  #from summarizer import Summarizer
4
 
5
- generate = pipeline(task='text-generation', model=AutoModelForCausalLM.from_pretrained("DemocracyStudio/generate_nft_content"), tokenizer=AutoTokenizer.from_pretrained("DemocracyStudio/generate_nft_content"))
6
  #summarize=Summarizer()
7
 
8
  st.title("Text generation for the marketing content of NFTs")
@@ -19,7 +19,8 @@ if choice == 'NFT':
19
  if st.button("Generate"):
20
  #st.text("Keywords: {}\n".format(keywords))
21
  #st.text("Length in number of words: {}\n".format(length))
22
- st.text("This is your tailored blog article:", generate("", num_return_sequences=1))
 
23
  #summary = summarize(generated_text, num_sentences=1)
24
  #st.text("This is a tweet-sized summary of your article: ", summary)
25
  else:
 
1
  import streamlit as st
2
+ from transformers import pipeline, GPT2LMHeadModel, AutoTokenizer
3
  #from summarizer import Summarizer
4
 
5
+ generate = pipeline(task='text-generation', model=GPT2LMHeadModel.from_pretrained("DemocracyStudio/generate_nft_content"), tokenizer=AutoTokenizer.from_pretrained("DemocracyStudio/generate_nft_content"))
6
  #summarize=Summarizer()
7
 
8
  st.title("Text generation for the marketing content of NFTs")
 
19
  if st.button("Generate"):
20
  #st.text("Keywords: {}\n".format(keywords))
21
  #st.text("Length in number of words: {}\n".format(length))
22
+ generated_text = generate("", num_return_sequences=1)
23
+ st.text("This is your tailored blog article:", generated_text)
24
  #summary = summarize(generated_text, num_sentences=1)
25
  #st.text("This is a tweet-sized summary of your article: ", summary)
26
  else: