OzoneAsai commited on
Commit
9a95130
·
1 Parent(s): acdbcde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -6,7 +6,7 @@ import torch
6
  from transformers import AutoModelForCausalLM, AutoTokenizer
7
 
8
  # モデルとトークナイザの初期化
9
- model = AutoModelForCausalLM.from_pretrained("cyberagent/open-calm-1b", device=torch.device("cuda" if torch.cuda.is_available() else "cpu"), torch_dtype=torch.float16)
10
  tokenizer = AutoTokenizer.from_pretrained("cyberagent/open-calm-1b")
11
 
12
  # 推論用の関数
 
6
  from transformers import AutoModelForCausalLM, AutoTokenizer
7
 
8
  # モデルとトークナイザの初期化
9
+ model = AutoModelForCausalLM.from_pretrained("cyberagent/open-calm-1b", device_map="cuda"), torch_dtype=torch.float16)
10
  tokenizer = AutoTokenizer.from_pretrained("cyberagent/open-calm-1b")
11
 
12
  # 推論用の関数