Spaces:
Runtime error
Runtime error
| 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") |