Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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")
|