Spaces:
vilarin
/
Running on Zero

vilarin commited on
Commit
fb7443f
·
verified ·
1 Parent(s): fd454d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
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, T5EncoderModel
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