Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

版本不兼容 #10

Open
Wyhtk opened this issue Dec 4, 2024 · 0 comments
Open

版本不兼容 #10

Wyhtk opened this issue Dec 4, 2024 · 0 comments

Comments

@Wyhtk
Copy link

Wyhtk commented Dec 4, 2024

运行stage2_financial_qa.sh时出现sentence-transformers和transformers版本不兼容的问题:
base_model_path: /home/lc/projects/pretrained_models/chatglm2-6b
lora_ckpt_path: /home/hf/AlphaFin-main/model/StockGPT-Stage2
embedding_model_path: /home/hf/AlphaFin-main/model/bge-large-zh
Traceback (most recent call last):
File "/home/hf/anaconda3/envs/alfin/lib/python3.9/site-packages/langchain/embeddings/huggingface.py", line 58, in init
import sentence_transformers
File "/home/hf/anaconda3/envs/alfin/lib/python3.9/site-packages/sentence_transformers/init.py", line 3, in
from .datasets import SentencesDataset, ParallelSentencesDataset
File "/home/hf/anaconda3/envs/alfin/lib/python3.9/site-packages/sentence_transformers/datasets/init.py", line 1, in
from .DenoisingAutoEncoderDataset import DenoisingAutoEncoderDataset
File "/home/hf/anaconda3/envs/alfin/lib/python3.9/site-packages/sentence_transformers/datasets/DenoisingAutoEncoderDataset.py", line 5, in
from transformers.utils.import_utils import is_nltk_available, NLTK_IMPORT_ERROR
ImportError: cannot import name 'is_nltk_available' from 'transformers.utils.import_utils' (/home/hf/anaconda3/envs/alfin/lib/python3.9/site-packages/transformers/utils/import_utils.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/hf/AlphaFin-main/src/stage2_financial_qa/webui/run.py", line 216, in
Fire(main)
File "/home/hf/anaconda3/envs/alfin/lib/python3.9/site-packages/fire/core.py", line 135, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/home/hf/anaconda3/envs/alfin/lib/python3.9/site-packages/fire/core.py", line 468, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/home/hf/anaconda3/envs/alfin/lib/python3.9/site-packages/fire/core.py", line 684, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/home/hf/AlphaFin-main/src/stage2_financial_qa/webui/run.py", line 170, in main
model, tokenizer, runner = getModel(base_model_path,
File "/home/hf/AlphaFin-main/src/stage2_financial_qa/webui/run.py", line 128, in getModel
runner = MyProcessor(embedding_model_path,
File "/home/hf/AlphaFin-main/src/stage2_financial_qa/webui/run.py", line 49, in init
self.embed = HuggingFaceEmbeddings(model_name=embedding_model_path, model_kwargs={'device': 'cpu'})
File "/home/hf/anaconda3/envs/alfin/lib/python3.9/site-packages/langchain/embeddings/huggingface.py", line 61, in init
raise ImportError(
ImportError: Could not import sentence_transformers python package. Please install it with pip install sentence-transformers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant