Spaces:
Runtime error
Runtime error
Commit
·
75a9f38
1
Parent(s):
5646b61
Predecessor to E2E Centauri Text Gen Web App
Browse files
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from aitextgen import aitextgen
|
| 3 |
+
# Downloading gpt neo from hugging face model hub
|
| 4 |
+
ai= aitextgen(model='EleutherAI/gpt-neo-125M', to_gpu=True)
|
| 5 |
+
def ai_text(input):
|
| 6 |
+
# returning text as string for gradio
|
| 7 |
+
generated_text= ai.generate_one(max_length=1000, prompt=input, no_repeat_ngram_size=3)
|
| 8 |
+
print(generated_text)
|
| 9 |
+
return generated_text
|
| 10 |
+
output_text=gr.outputs.Textbox()
|
| 11 |
+
gr.Interface(ai_text, "textbox",
|
| 12 |
+
output_text, title="Centauri Pilot",
|
| 13 |
+
description="Generating Blog Content using GPT-Neo by implementing aitextgen and Gradio").launch(inline=False)
|