awacke1 commited on
Commit
2fde736
1 Parent(s): db4b40d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B")
23
- generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
24
- generator1 = gr.Interface.load("huggingface/gpt2-large")
 
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)