Spaces:
Runtime error
Runtime error
stephenleejm
commited on
Commit
•
2afbee8
1
Parent(s):
68bab55
Upload app.py
Browse filesAdded title, description and examples
app.py
CHANGED
@@ -3,13 +3,13 @@ from transformers import T5ForConditionalGeneration, T5Tokenizer
|
|
3 |
import torch
|
4 |
|
5 |
|
6 |
-
title = "
|
7 |
-
description = "
|
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 |
-
['
|
11 |
-
[
|
12 |
-
[
|
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=[
|
|
|
|
|
|
|
|
|
|
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()
|