|
5 | 5 | import time
|
6 | 6 | from pathlib import PurePath
|
7 | 7 |
|
| 8 | + |
| 9 | +# Set environment variables |
| 10 | +STUDIO_HF_HOME = os.path.abspath(os.path.realpath(os.path.join(os.path.dirname(__file__), './hf_download'))) |
| 11 | +# maybe only set HF_HOME if the directory exists, providing an opt-in migration path for users |
| 12 | +# make sure to document this behavior if the HF_HOME changes in the future |
| 13 | +# Set the HF_HOME to the studio's hf_download directory |
| 14 | +# HF_HOME Must be set to its expected value prior to importing diffusers and transformers |
| 15 | +os.environ['HF_HOME'] = STUDIO_HF_HOME |
| 16 | +os.environ['TOKENIZERS_PARALLELISM'] = 'false' # Prevent tokenizers parallelism warning |
| 17 | + |
8 | 18 | # Site packages
|
9 | 19 | from diffusers import AutoencoderKLHunyuanVideo
|
10 | 20 | from transformers import LlamaModel, CLIPTextModel, LlamaTokenizerFast, CLIPTokenizer
|
|
28 | 38 | from modules.ui.queue import format_queue_status
|
29 | 39 | from modules.video_queue import JobStatus
|
30 | 40 |
|
31 |
| -# Set environment variables |
32 |
| -STUDIO_HF_HOME = os.path.abspath(os.path.realpath(os.path.join(os.path.dirname(__file__), './hf_download'))) |
33 |
| -# maybe only set HF_HOME if the directory exists, providing an opt-in migration path for users |
34 |
| -# make sure to document this behavior if the HF_HOME changes in the future |
35 |
| -# Set the HF_HOME to the studio's hf_download directory |
36 |
| -os.environ['HF_HOME'] = STUDIO_HF_HOME |
37 |
| -os.environ['TOKENIZERS_PARALLELISM'] = 'false' # Prevent tokenizers parallelism warning |
| 41 | + |
38 | 42 |
|
39 | 43 | # Try to suppress annoyingly persistent Windows asyncio proactor errors
|
40 | 44 | if os.name == 'nt': # Windows only
|
|
0 commit comments