Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
generator = pipeline("text-generation", model="distilgpt2")
|
4 |
+
def essay_generation(input_text):
|
5 |
+
return generator(input_text,max_length=250)
|
6 |
+
iface = gr.Interface(essay_generation,inputs="text",outputs="text",title='Essay Generator APP',theme = "dark-peach",examples=["what is data science?","What is Natural Language Processing","What is Time series?"], description="This app helps in generating text upto 250 characters.")
|
7 |
+
iface.launch(inline=False)
|