Mahathi commited on
Commit
9f7b4ec
1 Parent(s): 8b6403d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import torch
3
+ from transformers import AutoModelWithLMHead, AutoTokenizer
4
+
5
+ # Title and Description
6
+ st.title("Text Generation with Huggingface Model")
7
+ st.write("This program uses a huggingface model to generate text.")
8
+
9
+ # Tokenizer and Model
10
+ tokenizer = AutoTokenizer.from_pretrained("gpt2")
11
+ model = AutoModelWithLMHead.from_pretrained("gpt2")