stephenleejm commited on
Commit
2afbee8
1 Parent(s): 68bab55

Upload app.py

Browse files

Added title, description and examples

Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -3,13 +3,13 @@ from transformers import T5ForConditionalGeneration, T5Tokenizer
3
  import torch
4
 
5
 
6
- title = "GPT-J-6B"
7
- description = "Gradio Demo for GPT-J 6B, a transformer model trained using Ben Wang's Mesh Transformer JAX. 'GPT-J' refers to the class of model, while '6B' represents the number of trainable parameters. To use it, simply add your text, or click one of the examples to load them. I've used the API on this Space to deploy the GPT-J-6B model on a Telegram bot. Link to blog post below 👇"
8
  article = "<p style='text-align: center'><a href='https://dicksonneoh.com/portfolio/deploy_gpt_hf_models_on_telegram/' target='_blank'>⚡ Blog post 👉 Deploying GPT-J Models on a Telegram Bot with Hugging Face Hub - For Free</a></p>"
9
  examples = [
10
- ['The tower is 324 metres (1,063 ft) tall,'],
11
- ["The Moon's orbit around Earth has"],
12
- ["The smooth Borealis basin in the Northern Hemisphere covers 40%"]
13
  ]
14
 
15
  device = "cuda" if torch.cuda.is_available() else "cpu"
@@ -51,4 +51,8 @@ def run(dropdown, text):
51
 
52
 
53
  gr.Interface(fn=run,
54
- inputs=[gr.inputs.Dropdown(["Yoda To English", "English To Yoda"]),gr.inputs.Textbox(lines=5, label="Input Text")], outputs="text").launch()
 
 
 
 
 
3
  import torch
4
 
5
 
6
+ title = "Yoda Translation"
7
+ description = "This is my attempt at doing a Yoda Translator using T5. Feed it with about 20 examples and trained for 40 epochs."
8
  article = "<p style='text-align: center'><a href='https://dicksonneoh.com/portfolio/deploy_gpt_hf_models_on_telegram/' target='_blank'>⚡ Blog post 👉 Deploying GPT-J Models on a Telegram Bot with Hugging Face Hub - For Free</a></p>"
9
  examples = [
10
+ ['English To Yoda', "I am sick of you."],
11
+ ['Yoda To English','A challenge lifelong it is, not to bend fear into anger'],
12
+ ['Yoda To English','Luminous beings are we…not this crude matter']
13
  ]
14
 
15
  device = "cuda" if torch.cuda.is_available() else "cpu"
 
51
 
52
 
53
  gr.Interface(fn=run,
54
+ inputs=[
55
+ gr.inputs.Dropdown(["Yoda To English", "English To Yoda"], label="Task"),
56
+ gr.inputs.Textbox(lines=5, label="Input Text")],
57
+ outputs="text",
58
+ title=title, description=description, examples=examples).launch()