Hugging Face
Models
Datasets
Spaces
Buckets
new
Docs
Enterprise
Pricing
Website
Tasks
HuggingChat
Collections
Languages
Organizations
Community
Blog
Posts
Daily Papers
Hardware
Learn
Discord
Forum
GitHub
Solutions
Team & Enterprise
Hugging Face PRO
Enterprise Support
Inference Providers
Inference Endpoints
Storage Buckets
Log In
Sign Up
Spaces:
hysts
/
BLIP-Diffusion
like
12
Running
on
Zero
App
Files
Files
Community
3
Fetching metadata from the HF Docker repository...
refs/pr/2
BLIP-Diffusion
/
utils.py
hysts
HF Staff
Add files
0a359f0
almost 3 years ago
Raw
Download with hf CLI
Copy download link
History
Blame
216 Bytes
import
random
import
numpy
as
np
MAX_SEED = np.iinfo(np.int32).
max
def
randomize_seed_fn
(
seed:
int
, randomize_seed:
bool
) ->
int
:
if
randomize_seed:
seed = random.randint(
0
, MAX_SEED)
return
seed