Update app.py
Browse files
app.py
CHANGED
@@ -11,9 +11,12 @@ from transformers import GPT2LMHeadModel
|
|
11 |
|
12 |
|
13 |
model_name = "rinna/japanese-gpt-1b"
|
14 |
-
|
15 |
|
16 |
-
|
|
|
|
|
|
|
17 |
|
18 |
model = torch.quantization.quantize_dynamic(
|
19 |
model, {torch.nn.Linear}, dtype=torch.qint8)
|
|
|
11 |
|
12 |
|
13 |
model_name = "rinna/japanese-gpt-1b"
|
14 |
+
from huggingface_hub import snapshot_download
|
15 |
|
16 |
+
download_path = snapshot_download(repo_id=model_name)
|
17 |
+
model = GPT2LMHeadModel.from_pretrained(download_path)
|
18 |
+
|
19 |
+
tokenizer = T5Tokenizer.from_pretrained(download_path)
|
20 |
|
21 |
model = torch.quantization.quantize_dynamic(
|
22 |
model, {torch.nn.Linear}, dtype=torch.qint8)
|