Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files- app.py +16 -0
- requirements.txt +3 -0
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import gradio as gr
|
| 3 |
+
from aitextgen import aitextgen
|
| 4 |
+
ai = aitextgen(model="EleutherAI/gpt-neo-125M",to_gpu=True)
|
| 5 |
+
|
| 6 |
+
def ai_text(inp):
|
| 7 |
+
generated_text = ai.generate_one(max_length=1000, prompt = inp, no_repeat_ngram_size = 3)
|
| 8 |
+
print(type(generated_text))
|
| 9 |
+
return generated_text
|
| 10 |
+
|
| 11 |
+
output_text = gr.output.Textbox()
|
| 12 |
+
gr.Interface(ai_text,'texbox',output_text,title="Ai Generated Blog using GPT-Neo",
|
| 13 |
+
description="AI Generated Blog Content with GPT-Neo - via{aitextgen}").launch()
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio
|
| 2 |
+
aitextgen
|
| 3 |
+
|