Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import
|
3 |
import torch
|
4 |
-
import os
|
5 |
|
6 |
model_id = 'Bllossom/llama-3.2-Korean-Bllossom-3B'
|
7 |
|
@@ -9,11 +9,11 @@ model_id = 'Bllossom/llama-3.2-Korean-Bllossom-3B'
|
|
9 |
hf_access_token = os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
10 |
|
11 |
# ํ ํฌ๋์ด์ ์ ๋ชจ๋ธ ๋ก๋
|
12 |
-
tokenizer =
|
13 |
model_id,
|
14 |
use_auth_token=hf_access_token
|
15 |
)
|
16 |
-
model =
|
17 |
model_id,
|
18 |
torch_dtype=torch.bfloat16,
|
19 |
device_map="auto",
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
import torch
|
4 |
+
import os
|
5 |
|
6 |
model_id = 'Bllossom/llama-3.2-Korean-Bllossom-3B'
|
7 |
|
|
|
9 |
hf_access_token = os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
10 |
|
11 |
# ํ ํฌ๋์ด์ ์ ๋ชจ๋ธ ๋ก๋
|
12 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
13 |
model_id,
|
14 |
use_auth_token=hf_access_token
|
15 |
)
|
16 |
+
model = AutoModelForCausalLM.from_pretrained(
|
17 |
model_id,
|
18 |
torch_dtype=torch.bfloat16,
|
19 |
device_map="auto",
|