Spaces:
Runtime error
Runtime error
dorogan commited on
Commit ·
676808b
1
Parent(s): 542774a
Update: hf cache folder was manually provided
Browse files1234567891011from transformers import AutoTokenizer, AutoModelForCausalLMimport torchdevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')model_id = "CohereForAI/c4ai-command-r-v01-4bit"tokenizer = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained(model_id).to(device)## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>123456789101112131415from transformers import AutoTokenizer, AutoModelForCausalLMimport torchimport oshf_cache_folder = './huggingface_cache/'os.makedirs(hf_cache_folder, exist_ok=True)device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')model_id = "CohereForAI/c4ai-command-r-v01-4bit"tokenizer = AutoTokenizer.from_pretrained(model_id, cache_dir=hf_cache_folder)model = AutoModelForCausalLM.from_pretrained(model_id, cache_dir=hf_cache_folder).to(device)## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
model.py+6-2