Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from transformers import pipeline
|
3 |
title = "Transformers 📗 Sentence to Paragraph ❤️ For Mindfulness"
|
4 |
examples = [
|
@@ -19,8 +20,9 @@ from gradio import inputs
|
|
19 |
from gradio.inputs import Textbox
|
20 |
from gradio import outputs
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
25 |
gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."),
|
26 |
title=title, examples=examples).launch(share=False)
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
from transformers import pipeline
|
4 |
title = "Transformers 📗 Sentence to Paragraph ❤️ For Mindfulness"
|
5 |
examples = [
|
|
|
20 |
from gradio.inputs import Textbox
|
21 |
from gradio import outputs
|
22 |
|
23 |
+
HF_TOKEN = os.environ.get("HF_TOKEN") # get token from secrets, copy token value HF_TOKEN from Profile settings token into this repo settings
|
24 |
+
generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B", api_key=HF_TOKEN) # add api_key=HF_TOKEN to get over the quota error
|
25 |
+
generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B", api_key=HF_TOKEN)
|
26 |
+
generator1 = gr.Interface.load("huggingface/gpt2-large", api_key=HF_TOKEN)
|
27 |
gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."),
|
28 |
title=title, examples=examples).launch(share=False)
|