Upload scripts/eval_humaneval_v3_direct.py with huggingface_hub
Browse files
scripts/eval_humaneval_v3_direct.py
CHANGED
|
@@ -35,6 +35,14 @@ if torch.cuda.is_available():
|
|
| 35 |
print(f"GPU: {torch.cuda.get_device_name(0)}")
|
| 36 |
print(f"Memory: {torch.cuda.get_device_properties(0).total_memory / 1e9:.1f} GB")
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
# 4-bit quantization config
|
| 39 |
bnb_config = BitsAndBytesConfig(
|
| 40 |
load_in_4bit=True,
|
|
|
|
| 35 |
print(f"GPU: {torch.cuda.get_device_name(0)}")
|
| 36 |
print(f"Memory: {torch.cuda.get_device_properties(0).total_memory / 1e9:.1f} GB")
|
| 37 |
|
| 38 |
+
# Clear HF cache before loading to save storage
|
| 39 |
+
import shutil
|
| 40 |
+
cache_dir = os.path.expanduser("~/.cache/huggingface/hub")
|
| 41 |
+
if os.path.exists(cache_dir):
|
| 42 |
+
# Don't clear, but set HF to use minimal cache
|
| 43 |
+
pass
|
| 44 |
+
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
| 45 |
+
|
| 46 |
# 4-bit quantization config
|
| 47 |
bnb_config = BitsAndBytesConfig(
|
| 48 |
load_in_4bit=True,
|