Mahathi's picture
Create app.py
9f7b4ec
raw
history blame contribute delete
No virus
364 Bytes
import streamlit as st
import torch
from transformers import AutoModelWithLMHead, AutoTokenizer
# Title and Description
st.title("Text Generation with Huggingface Model")
st.write("This program uses a huggingface model to generate text.")
# Tokenizer and Model
tokenizer = AutoTokenizer.from_pretrained("gpt2")
model = AutoModelWithLMHead.from_pretrained("gpt2")