philschmid HF staff commited on
Commit
afc04b6
1 Parent(s): 68a3bfd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -24,11 +24,11 @@ if HF_TOKEN:
24
 
25
  # Load peft config for pre-trained checkpoint etc.
26
  device = "cuda" if torch.cuda.is_available() else "cpu"
27
- torch_dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] == 8 else torch.float16
28
  model_id = "philschmid/instruct-igel-001"
29
  if device == "cpu":
30
  model = AutoModelForCausalLM.from_pretrained(model_id, low_cpu_mem_usage=True)
31
  else:
 
32
  model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch_dtype, device_map="auto")
33
  tokenizer = AutoTokenizer.from_pretrained(model_id)
34
 
 
24
 
25
  # Load peft config for pre-trained checkpoint etc.
26
  device = "cuda" if torch.cuda.is_available() else "cpu"
 
27
  model_id = "philschmid/instruct-igel-001"
28
  if device == "cpu":
29
  model = AutoModelForCausalLM.from_pretrained(model_id, low_cpu_mem_usage=True)
30
  else:
31
+ torch_dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] == 8 else torch.float16
32
  model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch_dtype, device_map="auto")
33
  tokenizer = AutoTokenizer.from_pretrained(model_id)
34