Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'huggingface_hub.constants' has no attribute 'HF_HUB_CACHE'

I got this error after running:

import os 
import torch 
import torch.nn as nn  
from transformers import AutoTokenizer, AutoConfig,AutoModelForCausalLM 

I tried installing deferent versions of huggingface_hub, transformers, dataset and accelerate but the issue persists.

like image 773
ahmad Avatar asked Oct 22 '25 20:10

ahmad


1 Answers

At the nudging of @Henzelix above, the following worked for me:

pip install --upgrade huggingface_hub

like image 64
Rylan Schaeffer Avatar answered Oct 25 '25 10:10

Rylan Schaeffer