Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
VisualGLM-6B_pytorch
Commits
7b78e07f
Commit
7b78e07f
authored
Mar 02, 2024
by
wangsen
Browse files
Update model/infer_util.py
parent
626fed01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
model/infer_util.py
model/infer_util.py
+3
-1
No files found.
model/infer_util.py
View file @
7b78e07f
...
...
@@ -25,7 +25,9 @@ def get_infer_setting(gpu_device=0, quant=None):
quantize
(
model
.
transformer
,
quant
)
model
.
eval
()
model
=
model
.
cuda
()
tokenizer
=
AutoTokenizer
.
from_pretrained
(
"THUDM/chatglm-6b"
,
trust_remote_code
=
True
)
path
=
os
.
getcwd
()
newpath
=
path
+
"/data"
tokenizer
=
AutoTokenizer
.
from_pretrained
(
newpath
,
trust_remote_code
=
True
)
return
model
,
tokenizer
def
is_chinese
(
text
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment