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
textmonkey_pytorch
Commits
b7e01a51
Commit
b7e01a51
authored
Jul 12, 2024
by
wanglch
Browse files
Update README.md
parent
4e23543e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
README.md
README.md
+41
-0
No files found.
README.md
View file @
b7e01a51
...
...
@@ -117,6 +117,47 @@ pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple
--image_folder
--output_dir
同时微调代码还需要修改
[
finetune_multitask_dialouge_doc.py
](
TextMonkey/Monkey/finetune_multitask_dialouge_doc.py
)
中的路径为本地模型路径;
```
class ModelArguments:
model_name_or_path: Optional[str] = field(default="../TextMonkey/TextMonkey_base")
```
```
# Set RoPE scaling factor
config = MonkeyConfig.from_pretrained(
"../TextMonkey/TextMonkey_base",
cache_dir=training_args.cache_dir,
trust_remote_code=True,
)
```
```
model
=
TextMonkeyLMHeadModel
.
from_pretrained
(
model_args
.
model_name_or_path
,
config
=
config
,
cache_dir
=
training_args
.
cache_dir
,
device_map
=
device_map
,
trust_remote_code
=
True
,
quantization_config
=
GPTQConfig
(
bits
=
4
,
disable_exllama
=
True
)
if
training_args
.
use_lora
and
lora_args
.
q_lora
else
None
,
ignore_mismatched_sizes
=
True
)
tokenizer
=
QWenTokenizer
.
from_pretrained
(
model_args
.
model_name_or_path
,
cache_dir
=
training_args
.
cache_dir
,
model_max_length
=
training_args
.
model_max_length
,
padding_side
=
"right"
,
use_fast
=
False
,
trust_remote_code
=
True
,
)
```
### 单机多卡
训练需要8卡 A800 80G
...
...
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