Spaces:
Sleeping
Sleeping
Prgckwb
commited on
Commit
•
e5a75a4
1
Parent(s):
6c94b18
Add Japanese model
Browse files- app.py +4 -1
- requirements.txt +2 -1
app.py
CHANGED
@@ -3,6 +3,7 @@ import pandas as pd
|
|
3 |
from gradio.themes import colors
|
4 |
from transformers import AutoTokenizer
|
5 |
|
|
|
6 |
# Function to map tokenized text to IDs
|
7 |
def inference(
|
8 |
text="",
|
@@ -44,6 +45,7 @@ if __name__ == '__main__':
|
|
44 |
"google-bert/bert-base-uncased",
|
45 |
"google/flan-t5-base",
|
46 |
"openai-community/gpt2",
|
|
|
47 |
],
|
48 |
value="openai/clip-vit-large-patch14"
|
49 |
),
|
@@ -57,7 +59,8 @@ if __name__ == '__main__':
|
|
57 |
["Yesterday, I thought my cat was studying for her degree in philosophy because she sat on my book, "
|
58 |
"but turns out she was just trying to hatch a plot to steal my dinner.", "openai/clip-vit-large-patch14"],
|
59 |
["The square root of x is the cube root of y. What is y to the power of 2, if x = 4?",
|
60 |
-
"google/flan-t5-base"]
|
|
|
61 |
],
|
62 |
cache_examples=True,
|
63 |
title="TokenVisor",
|
|
|
3 |
from gradio.themes import colors
|
4 |
from transformers import AutoTokenizer
|
5 |
|
6 |
+
|
7 |
# Function to map tokenized text to IDs
|
8 |
def inference(
|
9 |
text="",
|
|
|
45 |
"google-bert/bert-base-uncased",
|
46 |
"google/flan-t5-base",
|
47 |
"openai-community/gpt2",
|
48 |
+
"rinna/japanese-gpt-1b"
|
49 |
],
|
50 |
value="openai/clip-vit-large-patch14"
|
51 |
),
|
|
|
59 |
["Yesterday, I thought my cat was studying for her degree in philosophy because she sat on my book, "
|
60 |
"but turns out she was just trying to hatch a plot to steal my dinner.", "openai/clip-vit-large-patch14"],
|
61 |
["The square root of x is the cube root of y. What is y to the power of 2, if x = 4?",
|
62 |
+
"google/flan-t5-base"],
|
63 |
+
["日本で一番高い山は富士山ですが、二番目に高い山は何ですか?", "rinna/japanese-gpt-1b"]
|
64 |
],
|
65 |
cache_examples=True,
|
66 |
title="TokenVisor",
|
requirements.txt
CHANGED
@@ -2,4 +2,5 @@ torch
|
|
2 |
transformers
|
3 |
safetensors
|
4 |
accelerate
|
5 |
-
diffusers
|
|
|
|
2 |
transformers
|
3 |
safetensors
|
4 |
accelerate
|
5 |
+
diffusers
|
6 |
+
sentencepiece
|