Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ class LlamaGuardModeration:
|
|
9 |
self.model = None
|
10 |
self.tokenizer = None
|
11 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
-
self.model_id = "meta-llama/Llama-Guard-3-8B"
|
13 |
self.dtype = torch.bfloat16
|
14 |
|
15 |
# HuggingFace tokenの取得
|
@@ -29,7 +29,7 @@ class LlamaGuardModeration:
|
|
29 |
token=self.huggingface_token
|
30 |
)
|
31 |
|
32 |
-
#
|
33 |
self.model = AutoModelForCausalLM.from_pretrained(
|
34 |
self.model_id,
|
35 |
torch_dtype=self.dtype,
|
|
|
9 |
self.model = None
|
10 |
self.tokenizer = None
|
11 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
+
self.model_id = "meta-llama/Llama-Guard-3-8B" # モデルIDを変更
|
13 |
self.dtype = torch.bfloat16
|
14 |
|
15 |
# HuggingFace tokenの取得
|
|
|
29 |
token=self.huggingface_token
|
30 |
)
|
31 |
|
32 |
+
# モデルの初期化
|
33 |
self.model = AutoModelForCausalLM.from_pretrained(
|
34 |
self.model_id,
|
35 |
torch_dtype=self.dtype,
|