Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ from diffusers.utils import load_image
|
|
13 |
from PIL import Image
|
14 |
import requests
|
15 |
import transformers
|
16 |
-
from transformers import AutoTokenizer,
|
17 |
from translatepy import Translator
|
18 |
|
19 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
@@ -59,9 +59,15 @@ text_encoder_3 = T5EncoderModel.from_pretrained(
|
|
59 |
torch_dtype=torch.float16,
|
60 |
)
|
61 |
|
|
|
|
|
|
|
|
|
|
|
62 |
tokenizer_3 = AutoTokenizer.from_pretrained(
|
63 |
repo,
|
64 |
subfolder="tokenizer_3",
|
|
|
65 |
torch_dtype=torch.float16,
|
66 |
)
|
67 |
|
|
|
13 |
from PIL import Image
|
14 |
import requests
|
15 |
import transformers
|
16 |
+
from transformers import AutoTokenizer, T5EncoderMode, PretrainedConfig
|
17 |
from translatepy import Translator
|
18 |
|
19 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
|
|
59 |
torch_dtype=torch.float16,
|
60 |
)
|
61 |
|
62 |
+
model_config = PretrainedConfig.from_pretrained(
|
63 |
+
repo,
|
64 |
+
subfolder="tokenizer_3",
|
65 |
+
)
|
66 |
+
|
67 |
tokenizer_3 = AutoTokenizer.from_pretrained(
|
68 |
repo,
|
69 |
subfolder="tokenizer_3",
|
70 |
+
config = model_config,
|
71 |
torch_dtype=torch.float16,
|
72 |
)
|
73 |
|