fix: 修改下载模型脚本
This commit is contained in:
parent
37376dc26f
commit
c29cd7ac24
@ -8,11 +8,10 @@
|
|||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
import os.path
|
import os.path
|
||||||
|
from pycrawlers import huggingface
|
||||||
from transformers import GPT2TokenizerFast
|
from transformers import GPT2TokenizerFast
|
||||||
import sentence_transformers
|
hg = huggingface()
|
||||||
|
prefix_dir = "./model"
|
||||||
prefix_dir = "/opt/maxkb/model"
|
|
||||||
model_config = [
|
model_config = [
|
||||||
{
|
{
|
||||||
'download_params': {
|
'download_params': {
|
||||||
@ -51,10 +50,10 @@ model_config = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'download_params': {
|
'download_params': {
|
||||||
'model_name_or_path': 'shibing624/text2vec-base-chinese',
|
'urls': ["https://huggingface.co/shibing624/text2vec-base-chinese/tree/main"],
|
||||||
'cache_folder': os.path.join(prefix_dir, 'embedding')
|
'file_save_paths': [os.path.join(prefix_dir, 'embedding',"shibing624_text2vec-base-chinese")]
|
||||||
},
|
},
|
||||||
'download_function': sentence_transformers.SentenceTransformer
|
'download_function': hg.get_batch_data
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user