You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[rank0]: Traceback (most recent call last):
[rank0]: File "/nfs_global/S/tianzikang/rocky/projects/spatial_intelligence/LLaMA-Factory/src/llamafactory/model/loader.py", line 71, in load_tokenizer
[rank0]: tokenizer = AutoTokenizer.from_pretrained(
[rank0]: File "/lustre/S/tianzikang/rocky/miniconda3/envs/omnigibson/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 939, in from_pretrained
[rank0]: return tokenizer_class_fast.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
[rank0]: File "/lustre/S/tianzikang/rocky/miniconda3/envs/omnigibson/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2197, in from_pretrained
[rank0]: raise EnvironmentError(
[rank0]: OSError: Can't load tokenizer for '/lustre/S/tianzikang/LLMs/mistralai-Pixtral-12B-2409/mistralai-Pixtral-12B-2409/'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure '/lustre/S/tianzikang/LLMs/mistralai-Pixtral-12B-2409/mistralai-Pixtral-12B-2409/' is the correct path to a directory containing all relevant files for a LlamaTokenizerFast tokenizer.
另外用指令API_PORT=8000 llamafactory-cli api examples/inference/pixtral_vllm.yaml也会报相同的错误,其中pixtral_vllm.yaml内容如下:
fromopenaiimportOpenAI# Modify OpenAI's API key and API base to use vLLM's API server.openai_api_key="EMPTY"openai_api_base="http://localhost:8000/v1"client=OpenAI(
api_key=openai_api_key,
base_url=openai_api_base,
)
completion=client.completions.create(model="/lustre/S/tianzikang/LLMs/mistralai-Pixtral-12B-2409/mistralai-Pixtral-12B-2409/",
prompt="San Francisco is a", max_tokens=8192, temperature=0.7)
print("Completion result:", completion.choices[0].text)
得到如下输出:
Completion result: beautiful city, and it’s no surprise that so many visitors flock to this area every year. There are so many things to doin San Francisco, from exploring the Golden Gate Bridge to walking along the Fisherman’s Wharf. Whether you’re looking fora fun family outing or want to enjoy some time alone, San Francisco is the perfect place for you. This blog post will discuss some of the best activitiesin San Francisco for families with kids.
balabala...
或者不将pixtral部署成api形式,直接用vllm推理,代码如下:
importos, syssys.path.append(os.path.join(os.path.dirname(__file__), '..'))
# from robosuite.environments.manipulation.spatial_intelligence import SpatialIntelligencefromvllmimportLLMfromvllm.sampling_paramsimportSamplingParamsmodel_name="/lustre/S/tianzikang/LLMs/mistralai-Pixtral-12B-2409/mistralai-Pixtral-12B-2409/"max_img_per_msg=5sampling_params=SamplingParams(max_tokens=8192, temperature=0.7)
# Lower max_num_seqs or max_model_len on low-VRAM GPUs.llm=LLM(model=model_name, tokenizer_mode="mistral", limit_mm_per_prompt={"image": max_img_per_msg}, max_model_len=32768)
messages= [
{
"role": "user",
"content": "San Francisco is a",
}
]
outputs=llm.chat(messages=messages, sampling_params=sampling_params)
print(outputs[0].outputs[0].text)
Reminder
System Info
llamafactory
version: 0.9.2.dev0Reproduction
我是将pixtral-12B的模型下载到了本地,如下:
随后我利用自己收集的dpo数据,用如下指令微调该模型
其中pixtral_lora_dpo.yaml的内容如下:
得到如下报错信息
另外用指令
API_PORT=8000 llamafactory-cli api examples/inference/pixtral_vllm.yaml
也会报相同的错误,其中pixtral_vllm.yaml
内容如下:该指令报错信息如下:
但是用mistral所给例子直接利用vllm框架推理,不会出现类似的错误。即
先
CUDA_VISIBLE_DEVICES=0 vllm serve /lustre/S/tianzikang/LLMs/mistralai-Pixtral-12B-2409/mistralai-Pixtral-12B-2409/ \ --tokenizer_mode mistral --limit_mm_per_prompt 'image=6' --max-model-len 32768
先以api的形式将pixtral部署,然后用如下代码问问题:得到如下输出:
或者不将pixtral部署成api形式,直接用vllm推理,代码如下:
同样可以得到输出,这说明我下载到本地的pixtral-12B模型是没有问题的,但确实无法使用llama-factory进行推理以及微调或者训练
我猜测是pixtral-12B已经以tekken.json的形式提供了tokenizer(因为可以通过
tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tekken.json")
的形式导入load该tokenizer),所以应该是llama-factory尚未支持这种形式的tokenizer吗?Others
No response
The text was updated successfully, but these errors were encountered: