Spaces:
Running
Running
Download env_setup.py from fsadeek/gemma-fine-tuning: direct link, hf CLI and curl.
- Browser
- Download file 832 Bytes
-
https://huggingface.co/spaces/fsadeek/gemma-fine-tuning/resolve/main/env_setup.py
- Command line
-
hf download hf://spaces/fsadeek/gemma-fine-tuning/env_setup.py
-
curl -L -o env_setup.py https://huggingface.co/spaces/fsadeek/gemma-fine-tuning/resolve/main/env_setup.py
832 Bytes
| """ | |
| Environment setup to handle library conflicts and dependencies | |
| """ | |
| import os | |
| import logging | |
| def setup_environment(): | |
| """Configure environment variables for the application""" | |
| # Disable TensorFlow warnings and prevent it from being loaded | |
| # This allows Transformers to work without TensorFlow dependencies | |
| os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" # Disable TensorFlow logging | |
| os.environ["USE_TORCH"] = "1" # Tell Transformers to use PyTorch | |
| os.environ["USE_TF"] = "0" # Tell Transformers not to use TensorFlow | |
| # Configure logging | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format='%(asctime)s - %(levelname)s - %(message)s' | |
| ) | |
| # Log environment settings | |
| logging.info("Environment configured: PyTorch enabled, TensorFlow disabled") | |
| return True | |