Skip to content

Instantly share code, notes, and snippets.

import torch
import streamlit as st
from transformers import BartTokenizer, BartForConditionalGeneration
from transformers import T5Tokenizer, T5ForConditionalGeneration
st.title('Text Summarization Demo')
st.markdown('Using BART and T5 transformer model')
model = st.selectbox('Select the model', ('BART', 'T5'))
@lazarinastoy
lazarinastoy / article_generation.py
Created May 24, 2021 11:56 — forked from tejeshb/article_generation.py
Article generation in website
#Import streamlit library
import streamlit as st
st.title("Medium Article Generator") #set title of website
starting_sentence = st.text_input(label='Enter Starting Sentence') #set input and label
#Function to run model and generate new text
@st.cache
def generate():
import gpt_2_simple as gpt2
import streamlit as st
from ludwig.api import LudwigModel
import pandas as pd
st.cache(show_spinner=False)
def load_model():
#Update with the path to the Ludwig trained model
model = LudwigModel.load("results/experiment_run_1/model/")
return model