BifrostTitan commited on
Commit
6c43e81
·
verified ·
1 Parent(s): 5902a9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -66,14 +66,13 @@ transformers.utils.logging.enable_explicit_format()
66
  model_id = "microsoft/bitnet-b1.58-2B-4T-bf16"
67
  tokenizer = AutoTokenizer.from_pretrained(model_id)
68
  hf_save_dir = "./bitnet"
69
-
70
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
71
  if torch.cuda.is_available():
72
  print("CUDA is available. Using GPU:", torch.cuda.get_device_name(0))
73
- model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
74
  else:
75
  print("CUDA not available; using CPU.")
76
- model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float32)
77
 
78
  model.to(device)
79
  print(f"Loaded pre-trained Hugging Face model '{model_id}'.")
 
66
  model_id = "microsoft/bitnet-b1.58-2B-4T-bf16"
67
  tokenizer = AutoTokenizer.from_pretrained(model_id)
68
  hf_save_dir = "./bitnet"
69
+ model = AutoModelForCausalLM.from_pretrained(model_id)
70
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
71
  if torch.cuda.is_available():
72
  print("CUDA is available. Using GPU:", torch.cuda.get_device_name(0))
 
73
  else:
74
  print("CUDA not available; using CPU.")
75
+
76
 
77
  model.to(device)
78
  print(f"Loaded pre-trained Hugging Face model '{model_id}'.")