jcarbonnell commited on
Commit
ef46537
1 Parent(s): 0de584b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,9 +1,8 @@
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")
9
 
@@ -21,7 +20,7 @@ if choice == 'NFT':
21
  #st.text("Length in number of words: {}\n".format(length))
22
  generated = generate(manual_input, max_length = 512, num_return_sequences=1)
23
  st.write(generated)
24
- tweet = summarize(generated, num_sentences=1)
25
  st.write(tweet)
26
  else:
27
  st.write("Topic not available yet")
 
1
  import streamlit as st
2
+ from transformers import pipeline, GPT2LMHeadModel, AutoTokenizer, BartForConditionalGeneration
 
3
 
4
  generate = pipeline(task='text-generation', model=GPT2LMHeadModel.from_pretrained("DemocracyStudio/generate_nft_content"), tokenizer=AutoTokenizer.from_pretrained("DemocracyStudio/generate_nft_content"))
5
+ summarize=BartForConditionalGeneration.from_pretrained("sshleifer/distilbart-cnn-12-6")
6
 
7
  st.title("Text generation for the marketing content of NFTs")
8
 
 
20
  #st.text("Length in number of words: {}\n".format(length))
21
  generated = generate(manual_input, max_length = 512, num_return_sequences=1)
22
  st.write(generated)
23
+ tweet = summarize(generated)
24
  st.write(tweet)
25
  else:
26
  st.write("Topic not available yet")