Create text_generator_three
Browse files- text_generator_three +15 -0
text_generator_three
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
api = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B")
|
| 4 |
+
|
| 5 |
+
def complete_with_gpt(text)
|
| 6 |
+
|
| 7 |
+
return text[:-50]
|
| 8 |
+
|
| 9 |
+
with gr.Blocks() as demo:
|
| 10 |
+
with gr.Row():
|
| 11 |
+
textbox = gr.Textbox(placeholder="Type here and press enter...", lines=8)
|
| 12 |
+
with gr.Column():
|
| 13 |
+
btn = gr.Button("Generate")
|
| 14 |
+
btn.click(complete_with_gpt, textbox, textbox)
|
| 15 |
+
demo.launch()
|