Spaces:
Sleeping
Sleeping
ganchengguang
commited on
Commit
•
f6f833c
1
Parent(s):
cb20107
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
3 |
|
4 |
# 加载本地模型和tokenizer
|
5 |
model_name = "ganchengguang/OIELLM-8B-Instruction" # 替换为你的模型名称
|
6 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
7 |
model = AutoModelForCausalLM.from_pretrained(
|
8 |
model_name,
|
9 |
-
|
10 |
-
device_map='auto',
|
11 |
low_cpu_mem_usage=True
|
12 |
)
|
13 |
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
+
import torch
|
4 |
|
5 |
# 加载本地模型和tokenizer
|
6 |
model_name = "ganchengguang/OIELLM-8B-Instruction" # 替换为你的模型名称
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
model = AutoModelForCausalLM.from_pretrained(
|
9 |
model_name,
|
10 |
+
torch_dtype=torch.float16,
|
|
|
11 |
low_cpu_mem_usage=True
|
12 |
)
|
13 |
|