Spaces:
Runtime error
Runtime error
Remove use token option
Browse files
app.py
CHANGED
@@ -9,24 +9,16 @@ DEVICE_NAME = os.getenv("DEVICE_NAME", "cuda")
|
|
9 |
|
10 |
|
11 |
def load_translation_models(translation_model_id):
|
12 |
-
tokenizer = MBart50TokenizerFast.from_pretrained(
|
13 |
-
translation_model_id,
|
14 |
-
use_auth_token=True
|
15 |
-
)
|
16 |
tokenizer.src_lang = 'pt_XX'
|
17 |
-
text_model =
|
18 |
-
translation_model_id
|
19 |
-
use_auth_token=True
|
20 |
-
)
|
21 |
|
22 |
return tokenizer, text_model
|
23 |
|
24 |
|
25 |
def pipeline_generate(diffusion_model_id):
|
26 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
27 |
-
diffusion_model_id,
|
28 |
-
use_auth_token=True
|
29 |
-
)
|
30 |
pipe = pipe.to(DEVICE_NAME)
|
31 |
|
32 |
# Recommended if your computer has < 64 GB of RAM
|
|
|
9 |
|
10 |
|
11 |
def load_translation_models(translation_model_id):
|
12 |
+
tokenizer = MBart50TokenizerFast.from_pretrained(translation_model_id)
|
|
|
|
|
|
|
13 |
tokenizer.src_lang = 'pt_XX'
|
14 |
+
text_model = \
|
15 |
+
MBartForConditionalGeneration.from_pretrained(translation_model_id)
|
|
|
|
|
16 |
|
17 |
return tokenizer, text_model
|
18 |
|
19 |
|
20 |
def pipeline_generate(diffusion_model_id):
|
21 |
+
pipe = StableDiffusionPipeline.from_pretrained(diffusion_model_id)
|
|
|
|
|
|
|
22 |
pipe = pipe.to(DEVICE_NAME)
|
23 |
|
24 |
# Recommended if your computer has < 64 GB of RAM
|