Spaces:
Paused
Paused
added token
Browse files
app.py
CHANGED
@@ -7,6 +7,9 @@ from transformers import (
|
|
7 |
WhisperProcessor,
|
8 |
)
|
9 |
|
|
|
|
|
|
|
10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
11 |
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small").to(device)
|
12 |
processor = WhisperProcessor.from_pretrained("openai/whisper-small")
|
@@ -16,6 +19,7 @@ diffuser_pipeline = DiffusionPipeline.from_pretrained(
|
|
16 |
custom_pipeline="speech_to_image_diffusion",
|
17 |
speech_model=model,
|
18 |
speech_processor=processor,
|
|
|
19 |
revision="fp16",
|
20 |
torch_dtype=torch.float16,
|
21 |
)
|
|
|
7 |
WhisperProcessor,
|
8 |
)
|
9 |
|
10 |
+
import os
|
11 |
+
MY_SECRET_TOKEN=os.environ.get('HF_TOKEN_SD')
|
12 |
+
|
13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
14 |
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small").to(device)
|
15 |
processor = WhisperProcessor.from_pretrained("openai/whisper-small")
|
|
|
19 |
custom_pipeline="speech_to_image_diffusion",
|
20 |
speech_model=model,
|
21 |
speech_processor=processor,
|
22 |
+
use_auth_token=MY_SECRET_TOKEN,
|
23 |
revision="fp16",
|
24 |
torch_dtype=torch.float16,
|
25 |
)
|