Giter Club home page Giter Club logo

ai4finance-foundation / fingpt Goto Github PK

View Code? Open in Web Editor NEW
11.5K 232.0 1.7K 11.71 MB

FinGPT: Open-Source Financial Large Language Models! Revolutionize 🔥 We release the trained model on HuggingFace.

Home Page: https://ai4finance.org

License: MIT License

Python 11.85% Jupyter Notebook 87.45% Shell 0.68% TypeScript 0.03%
chatgpt finance fintech large-language-models machine-learning nlp prompt-engineering pytorch reinforcement-learning robo-advisor

fingpt's People

Contributors

0armaan025 avatar amayuelas avatar asmcos avatar bhadreshpsavani avatar bhargavshirin avatar boyuzh avatar bruceyanghy avatar eleniverteouri avatar eltociear avatar gasonbai avatar guichardvictor avatar gxxu-ml avatar kalyanimhala avatar kris248 avatar llk010502 avatar mmmarchetti avatar noir97 avatar oliverwang15 avatar pitmonticone avatar pschofield2 avatar radientbrain avatar raphaelzhou1 avatar shahupdates avatar shivam250702 avatar theredstoneradiant avatar williamgazeley avatar xjtlumedia avatar yangletliu avatar yonv1943 avatar zhumingpassional avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fingpt's Issues

download_content.py has problem

使用这个文件得到数据的时候会报错If using all scalar values, you must pass an index,并且运行很久也没有结果,能帮忙一下吗

FinGPT-v1 , errors with download_titles.py

I don't understand what does al_re mean ?

# ATTENTION! Should replace this with your results path!
al_re = os.listdir(r"D:\python_project\FinRL-Meta\experiment\scrape\results")
al_re = [al.split(".")[0] for al in al_re]

Training Killed

Attempted to run default FinGPT\fingpt\FinGPT-v3\benchmark\benchmarks.ipynb. The only change was commenting v3.1.

# v3.1
#base_model = "THUDM/chatglm2-6b"
#peft_model = "oliverwang15/FinGPT_v31_ChatGLM2_Sentiment_Instruction_LoRA_FT"
#tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
#model = AutoModel.from_pretrained(base_model, trust_remote_code=True, load_in_8bit = False, device_map = "auto")
#model = PeftModel.from_pretrained(model, peft_model)
#model = model.eval()

Processes was killed with no results.

image

这个组织中这么多库 Fin-Meta, Fin-NLP, FinRL, Prodracer, FinGPT 对于新手来说应该如何选择?

感谢团队的分享, 我也看了很多关于AI4Finance的资料,作为一个新手小白,我想入门金融的强化学习,但是被这么多的库砸晕了。

他们都是什么关系,是版本更新,还是并且共存,是否有先后顺序,都处于更新中吗?有更新的优先级吗?
作为一个新手程序员,有些python和pytorch的基础,应该从哪个库入手。
Fin-Meta好像是数据层的, 那么在Fin-RL 和Fin-GPT中的数据层是否还是用Fin-Meta来做的? 还是每一个库都是独立的?

这些库中,哪个是最新的能学习如何应用强化学习的?

希望能有一篇内容介绍这些库的关系,已经在当下的时间点,学习哪个库才是最合适的选择。谢谢

on_filled

why it doesn't have the same signature as on_execution

在FinGPT-v1的例子,执行 finetune.sh脚本训练时间

我目前用两只股票(茅台和福耀玻璃),大约有70M,在执行 finetune.sh脚本的时候,一切都正常,但是训练时间很短,只有几分钟,这个正常吗,生成的outdir 看着没啥问题,运行环境是 Tesla V100 SXM2 32GB 使用Fn16

执行finetune.sh 之后,效果不理想

目前我爬取了5只股票(东方财富的资讯),大约有4w条数据,执行finetune.sh 日志如下图
image
执行脚本参数
python -u finetune.py
--dataset_path "/data/program/data/dataset6/jsonl/dataset_title_train_and_valid"
--lora_rank 8
--per_device_train_batch_size 16
--per_device_eval_batch_size 16
--gradient_accumulation_steps 1
--num_train_epochs 1
--save_steps 100
--save_total_limit 5
--learning_rate 1e-6
--fp16
--remove_unused_columns false
--logging_steps 10
--eval_steps 100
--load_best_model_at_end true
--evaluation_strategy "steps"
--output_dir "/data/program/data/dataset6/model" > train.log 2>&1

然后运行infer 通过测试数据做了对比
image

通过这些指标看效果不好,是参数样本数据少还是样本数据有问题?

Open AI key present in the code.

In the source fingpt/chatgpt-trading-v2/openai_token/token_.py the Openai secret key is present. Request to remove and disable token.

How to make dataset_title_test.json file?

I try FinGPT-v1/data_preparations.
I have use add_labels.py make results_with_content/*.csv

How to make dataset_title_test.json?

I find example: instructions = json.load(open("/root/FinGPT-ChatGLM-Fineturning/data/title/dataset_title_test.json"))
The file is alpaca format ?

在执行infer.ipynb 时,文件里面的两个目录问题

root_path = "/root/autodl-tmp/results"
instructions = pd.read_csv(f"{root_path}/results_new.csv")
instructions.shape
ori_instructions = pd.read_csv(f"{root_path}/results.csv")
ori_instructions.shape

这两个文件从哪里获取的,没有看到生成的代码

Trying to replicate the work

Hi Authors,

Thanks to open-source this great work.

I am wondering:

  1. if the FinGPT refered in the finGPT paper V1 or V2? I guess it is V2 but under v2 I only found a simple script for downloading some data.
  2. it seems that I didn't see the "stock return RL" step on the script. And there is no evaluation metric shown in the paper. Is there any quantitative evidence shows Stock return RL improve performance on some tasks?
  3. It seems there is no instruction on README showing how to replicate the work from 0 to 1 that is demonstrated on the FinGPT website demo

Could you please provide some information about these?

Thanks,

chatgpt-trading-v2\trade_with_gpt3.ipynb run error

你好,我在trade_with_gpt3.ipynb 中把env_args的stock_name 换成“MSFT”,运行中会出现
KeyError: 'microsoft corporation : microsoft assigned patent $ msft URL'错误,目前发现除了AAPL可以,有的会有失败
MSFT

Quantitative sentiment analysis

Small issue to flag here; in the training data I see the author has determined this to be neutral -

_Example 4:

News: “Estee Lauder Q2 adj. EPS $2.11; FactSet consensus $1.90.”

The statement about Estee Lauder and FactSet consensus is neutral, as it merely states the facts without indicating a positive or negative sentiment. Here, FinGPT accurately identifies the neutrality of the statement._

Quantitatively, this is an EPS beat by $0.21 which may be enough for the stock to reactive positively to the news. I'd suggest we count this as "positive sentiment" not "neutral sentiment". I know the LLM is going to struggle with numerical analysis but this is what we need to really drive the AI to the promised land.

We are entering very grey territory once the reported EPS is within a certain range of consensus. Understanding the standard deviation within consensus estimates would really help determine if something is within the boundary of "neutral" "positive" or "negative" but this is likely a too granular at this point.

training resources

Hello, I would like to ask can the full training of fingpt be done on colab with A100? How long will it take.

FinGPT-v1 finetune.py. ValueError: You can't train a model that has been loaded in 8-bit precision on a different device than the one you're training on.

When running FinGPT-v1/training/finetune.py, there is an error:

You are adding a <class 'transformers.integrations.TensorBoardCallback'> to the callbacks of this Trainer, but there is already one. The currentlist of callbacks is
:DefaultFlowCallback
TensorBoardCallback
/data/kexin/anaconda3/envs/fingpt/lib/python3.8/site-packages/transformers/optimization.py:411: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set 'no_deprecation_warning=True' to disable this warning
 warnings.warn(
Traceback (most recent call last):
 File "/data/kexin/project/FinGPT/fingpt/FinGPT-v1/training/finetune.py", line 144, in <module>
   main()
 File "/data/kexin/project/FinGPT/fingpt/FinGPT-v1/training/finetune.py", line 137, in main
   trainer.train()
 File "/data/kexin/anaconda3/envs/fingpt/lib/python3.8/site-packages/transformers/trainer.py", line 1645, in train
   return inner_training_loop(
 File "/data/kexin/anaconda3/envs/fingpt/lib/python3.8/site-packages/transformers/trainer.py", line 1756, in _inner_training_loop
   model, self.optimizer = self.accelerator.prepare(self.model, self.optimizer)
 File "/data/kexin/anaconda3/envs/fingpt/lib/python3.8/site-packages/accelerate/accelerator.py", line 1182, in prepare
   result = tuple(
 File "/data/kexin/anaconda3/envs/fingpt/lib/python3.8/site-packages/accelerate/accelerator.py", line 1183, in <genexpr>
   self._prepare_one(obj, first_pass=True, device_placement=d) for obj, d in zip(args, device_placement)
 File "/data/kexin/anaconda3/envs/fingpt/lib/python3.8/site-packages/accelerate/accelerator.py", line 1022, in _prepare_one
   return self.prepare_model(obj, device_placement=device_placement)
 File "/data/kexin/anaconda3/envs/fingpt/lib/python3.8/site-packages/accelerate/accelerator.py", line 1258, in prepare_model
   raise ValueError(
ValueError: You can't train a model that has been loaded in 8-bit precision on a different device than the one you're training on. Make sure you loaded the model on the correct device using for example 'device_map={'':torch.cuda.current_device()}you're training on. Make sure you loaded the model on the correct device using for example 'device_map={'':torch.cuda.current_device() or device_map={'':torch.xpu.current_device()}
Process finished with exit code 1

It seems like it's caused by loading in 8-bit. What should I do to fix it? Thanks for your help

FinGPT-v1 download_contents.py bug modify

I made two changes:

There was an error in judging the status
The content could not be obtained because of the web page revision, and the modification is as follows:

    while not ok:
        try:
            response = requests.get(url = url, headers = headers)
            print(url,response.status_code)
            if response.status_code == 200:
                res = etree.HTML(response.text)
                res = res.xpath("//script[2]//text()")[0]
                res = json.loads(res[17:])
                res = pd.Series(res).to_frame().T
                ok = True
                return res
        except :
            pass

报错信息如下,请指教。

Mac系统,CPU i7 内存16G, 下载了001-007的文件;运行报错:
/Users/kongfanyu/Downloads/MyFinGPT/venv/bin/python /Users/kongfanyu/Downloads/MyFinGPT/fingpt/FinGPT-v3/test.py
Traceback (most recent call last):
File "/Users/kongfanyu/Downloads/MyFinGPT/fingpt/FinGPT-v3/test.py", line 13, in
model = AutoModel.from_pretrained(base_model, trust_remote_code=True, device_map="auto")
File "/Users/kongfanyu/Downloads/MyFinGPT/venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 558, in from_pretrained
return model_class.from_pretrained(
File "/Users/kongfanyu/Downloads/MyFinGPT/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3175, in from_pretrained
) = cls._load_pretrained_model(
File "/Users/kongfanyu/Downloads/MyFinGPT/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3296, in _load_pretrained_model
raise ValueError(
ValueError: The current device_map had weights offloaded to the disk. Please provide an offload_folder for them. Alternatively, make sure you have safetensors installed if the model you are using offers the weights in this format.

进程已结束,退出代码1

I encountered a problem while executing download_contents.py

When executing download_contents.py, the system became unresponsive without any error logs or prompts.
微信图片_20230630171100

Additionally, could you provide a tutorial outlining the installation steps for this model, the installation and support of the required companion models? Is it possible to obtain instructions for using this model and performing trend analysis and investment recommendations for a specific stock after training the model with data?"

当执行download_contents.py时,系统停止了响应,无报错日志和提示。
微信图片_20230630171100
另外一个问题,可否出一个教程,介绍一下这个模型的安装步骤、需要的配套模型的安装和支持,能不能下这个模型的使用方法,
经过数据训练后如何对某一只股票进行趋势分析和投资建议。

How to install the this on my Mac ?

Hello Team ,

came across this REPO and wanted to explore more but i wanted to know the installation steps to try this out on my mac.

can anyone please help me with the steps for the same?

Thanks in advance :)

Please remove the youtube videos from the readme

They are completely useless videos made from youtubers and would made a quant laugh.
First of all they start by applying the "super easily AI made trading system" to an already rockstar instrument (ie Bitcoin, AAPL, TSLA, whatever), and they intentionally leave the "Buy and Hold" stats out.
If they'd included it you'd see that you wouldn't need ANY system AT ALL to make insane returns with those instruments if you bought them at the beginning.. so they're cheating from the start.

Plus you cannot use Tradingview (IN SAMPLE DATA) to backtest/create a proper trading system.
Proper/robust trading systems need to be build with a "Walk Forward" approach using OUT OF SAMPLE data, carefully crafted so that it cannot peak into the future. You'd need specialized software for that.

http://www.codefortraders.com/Walk-Forward_Analysis/WFA_Introduction.htm

Could AI help here? Definitely. But not like this.

It did not work when I try to convert the default model "chatglm2" to "llama2"

Thanks for your awesome project. I reproduced the FinGPT v3.1.2 (4-bit QLoRA). It does work with the default LLM model "chatglm2" on Colab, but it comes to a halt when I wanna get better results with Llama2.

  • I have changed the model as per your instructions, modifying model_name = "THUDM/chatglm2-6b" to model_name = "daryl149/llama-2-7b-chat-hf"

  • Then removed the device due to running error:

model = AutoModel.from_pretrained(
        model_name,
        quantization_config=q_config,
        trust_remote_code=True,
        token = access_token,
        # device='cuda'
    )
  • Changed the target_modules to llama:
    target_modules = TRANSFORMERS_MODELS_TO_LORA_TARGET_MODULES_MAPPING['llama']

  • Unfortunately, the final step got a TypeError: 'NoneType' object cannot be interpreted as an integer

writer = SummaryWriter()
trainer = ModifiedTrainer(
    model=model,
    args=training_args,             # Trainer args
    train_dataset=dataset["train"], # Training set
    eval_dataset=dataset["test"],   # Testing set
    data_collator=data_collator,    # Data Collator
    callbacks=[TensorBoardCallback(writer)],
)
trainer.train()
writer.close()
# save model
model.save_pretrained(training_args.output_dir)

The detail error as follows:

You are adding a <class 'transformers.integrations.TensorBoardCallback'> to the callbacks of this Trainer, but there is already one. The currentlist of callbacks is
:DefaultFlowCallback
TensorBoardCallback
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-27-d05cf508c134> in <cell line: 11>()
      9     callbacks=[TensorBoardCallback(writer)],
     10 )
---> 11 trainer.train()
     12 writer.close()
     13 # save model

6 frames
<ipython-input-25-26476d7038e4> in data_collator(features)
     37         ids = ids + [tokenizer.pad_token_id] * (longest - ids_l)
     38         _ids = torch.LongTensor(ids)
---> 39         labels_list.append(torch.LongTensor(labels))
     40         input_ids.append(_ids)
     41     input_ids = torch.stack(input_ids)

TypeError: 'NoneType' object cannot be interpreted as an integer

Could you please do me a favor resolving this issue? Looking forward to your reply!
(Platform: A100 on Google Colab)

Setup Configuration Improvements in FinGPT

There are a few improvements that can enhance its readability and maintainability. Here are the details:

Error Handling for Missing Requirements File:
The code attempts to read the requirements.txt file to gather the project's dependencies. However, if the file is not found, the code simply prints an error message to the console. It would be better to raise an exception or exit the setup process with an appropriate error message to inform the user of the missing file.

Use of "with" Statement for File Handling:
The code currently uses a try-except block to handle file operations without utilizing the recommended with statement. Using with ensures proper handling of file resources, including automatic closing, even if an exception occurs.

Consistent Quoting Style:
The code uses both single and double quotes for string literals. It is recommended to use a consistent quoting style throughout the codebase to improve readability. Choose either single quotes or double quotes and apply it consistently.

To improve the code, consider the following suggestions:

from setuptools import setup, find_packages

# Read requirements.txt, ignore comments
try:
    with open("requirements.txt", "r") as f:
        REQUIRES = [line.split('#', 1)[0].strip() for line in f if line.strip()]
except FileNotFoundError:
    raise FileNotFoundError("requirements.txt not found!")

setup(
    name="FinGPT",
    version="0.0.0",
    include_package_data=True,
    author="Hongyang Yang, Xiao-Yang Liu",
    author_email="[email protected]",
    url="https://github.com/AI4Finance-Foundation/FinGPT",
    license="MIT",
    packages=find_packages(),
    install_requires=REQUIRES,
    description="FinGPT",
    long_description="FinGPT",
    classifiers=[
        # Trove classifiers
        # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
    ],
    keywords="Financial Large Language Models",
    platforms=["any"],
    python_requires=">=3.6",
)

Too many attempt to download; and 'other_code_list' is not defined

Hello,

When trying to download the data for US model, there seem many attempt threads been started, while most of them are interrupted, guessing this is a issue from the website?

Also, after the first download is completed, it will run "for stock in tqdm(other_code_list):", but "other_code_list" seems not defined.

Any suggestion, thanks.
alex

Reinforcement Learning on Stock Prices

Thank you for your works.
How to fine-tune with Reinforcement Learning on Stock Prices?.
Can you provide the source code for training with RLSP?
Thanks

title??

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

FinGPT-v1, only 1 type of instruction used in tuning?

In FinGPT-v1, there is only 1 type of instruction being used as model input during fine-tuning:
"instruction": "What is the sentiment of this news? Answer:{very negative/negative/neutral/positive/very positive} \n input": "今天的日期为:2023-06-12。\n新闻标题为:\"南山铝业本周融资净偿还862.5万元,居有色金属板块第九\"。

Did you only use this type of instruction? Or you designed other instructions for different tasks and used them for tuning? If you used other instructions, may I ask if they can be made public? Thank you.

For training quantitative trading, you only need to train transaction data.

作为经常和成熟能够稳定盈利交易者打交道的从业人员,程序是能够从市场成交数据上看出市场的情绪。因为市场的消息是滞后,且大多数是不真实的,所以直接用成交数据来训练模型才是出路。就像是扑克游戏一样,只根据对手每个回合下注比例和行为,就足够判断对方情绪和牌力了。

As a practitioner who regularly deals with mature, stable and profitable traders, the program is able to read market sentiment from market turnover data. Because market information is lagging and mostly untrue, training models directly on trading data is the way to go. Just like a poker game, it is enough to judge the opponent's mood and card power based on the proportion of bets and behavior of the opponent each turn.

我对国内交易市场的渠道是熟悉的,或许我们能够沟通出好的思路。训练交易或许并不需要爬取太多是市场资讯,这会让我们走更多的弯路。如果有需要我帮助介绍国内期货交易市场,和相关交易数据获取的问题,可以找我。

I am familiar with the channels of the domestic trading market, maybe we can communicate a good idea.

Pretrained model and Using instruction.

Hello, nice work.

I would like to ask when the trained model will be open sourced and how I can call the trained model input text to predict the stock price.

Thank you.

Juchao_Annoumcement 拼写错误 请修改为o Juchao_Announcement

Juchao_Annoumcement 拼写错误,实际是Juchao_Announcement ,demo文件中多个地方拼写错误,导致无法import‘’
这个示例代码:ChatGPT_Robo_Advisor_v2.ipynb中有2处
1、from finnlp.data_sources.company_announcement.juchao import Juchao_Annoumcement
2、 "downloader = Juchao_Annoumcement()"

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

在运行 python3 shares_news_sentiment_classify.py 时报下面错误, 你们是否遇到过?

File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1458, in connect
self.sock = self._context.wrap_socket(self.sock,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 517, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1108, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1379, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

dataset分享

有人可以分享一下从东方财富中下载的数据么?我运行download_contents已经一天了,程序仍然在运行,但是无任何输出结果。

希望取得联系

尊敬的FinGPT 应用开发者,我是 InternLM 社区开发者&志愿者尖米, 大佬开源的工作对我的启发很大,希望可以探讨使用 InternLM 实现FinGPT 的可能性和实现路径,我的微信是mzm312,希望可以取得联系进行更深度的交流。

when I run finetune.sh shell,RuntimeError: Only Tensors of floating point and complex dtype can require gradients

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues

CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...
/home/ubuntu/.local/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/usr/local/cuda/
lib64')}
warn(msg)
/home/ubuntu/.local/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: No libcudart.so found! Install CUDA or the cudatoolkit package (anaconda)!
warn(msg)
CUDA SETUP: Highest compute capability among GPUs detected: 7.0
CUDA SETUP: Detected CUDA version 117
/home/ubuntu/.local/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: Compute capability < 7.5 detected! Only slow 8-bit matmul is supported for your GPU!
warn(msg)
CUDA SETUP: Loading binary /home/ubuntu/.local/lib/python3.8/site-packages/bitsandbytes/libbitsandbytes_cpu.so...
/home/ubuntu/.local/lib/python3.8/site-packages/bitsandbytes/cextension.py:31: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers and GPU quantization are unavai
lable.
warn("The installed version of bitsandbytes was compiled without GPU support. "
No compiled kernel found.
Compiling kernels : /home/ubuntu/.cache/huggingface/modules/transformers_modules/chatglm-6b-int8/quantization_kernels_parallel.c
Compiling gcc -O3 -fPIC -pthread -fopenmp -std=c99 /home/ubuntu/.cache/huggingface/modules/transformers_modules/chatglm-6b-int8/quantization_kernels_parallel.c -shared -o /home/ubuntu/.cache/huggingface/modules/t
ransformers_modules/chatglm-6b-int8/quantization_kernels_parallel.so
Load kernel : /home/ubuntu/.cache/huggingface/modules/transformers_modules/chatglm-6b-int8/quantization_kernels_parallel.so
Setting CPU quantization kernel threads to 5
Using quantization cache
Applying quantization to glm layers
Traceback (most recent call last):
File "finetune.py", line 137, in
main()
File "finetune.py", line 90, in main
model = AutoModel.from_pretrained(
File "/home/ubuntu/.local/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 479, in from_pretrained
return model_class.from_pretrained(
File "/home/ubuntu/.local/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2675, in from_pretrained
model = cls(config, *model_args, **model_kwargs)
File "/home/ubuntu/.cache/huggingface/modules/transformers_modules/chatglm-6b-int8/modeling_chatglm.py", line 1061, in init
self.quantize(self.config.quantization_bit, self.config.quantization_embeddings, use_quantization_cache=True, empty_init=True)
File "/home/ubuntu/.cache/huggingface/modules/transformers_modules/chatglm-6b-int8/modeling_chatglm.py", line 1439, in quantize
self.transformer = quantize(self.transformer, bits, use_quantization_cache=use_quantization_cache, empty_init=empty_init, **kwargs)
File "/home/ubuntu/.cache/huggingface/modules/transformers_modules/chatglm-6b-int8/quantization.py", line 501, in quantize
layer.attention.query_key_value = QuantizedLinearWithPara(
File "/home/ubuntu/.cache/huggingface/modules/transformers_modules/chatglm-6b-int8/quantization.py", line 374, in init
self.weight = Parameter(self.weight.to(kwargs["device"]), requires_grad=False)
File "/home/ubuntu/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1632, in setattr
self.register_parameter(name, value)
File "/home/ubuntu/.local/lib/python3.8/site-packages/accelerate/big_modeling.py", line 108, in register_empty_parameter
module._parameters[name] = param_cls(module._parameters[name].to(device), **kwargs)
File "/home/ubuntu/.local/lib/python3.8/site-packages/torch/nn/parameter.py", line 36, in new
return torch.Tensor._make_subclass(cls, data, requires_grad)
RuntimeError: Only Tensors of floating point and complex dtype can require gradients

环境: ubuntu
GPU: [Tesla V100 SXM2 32GB] GPU是 32G的
config.json
{
"_name_or_path": "THUDM/chatglm-6b-int8",
"architectures": [
"ChatGLMModel"
],
"auto_map": {
"AutoConfig": "configuration_chatglm.ChatGLMConfig",
"AutoModel": "modeling_chatglm.ChatGLMForConditionalGeneration",
"AutoModelForSeq2SeqLM": "modeling_chatglm.ChatGLMForConditionalGeneration"
},
"bos_token_id": 130004,
"eos_token_id": 130005,
"gmask_token_id": 130001,
"hidden_size": 4096,
"inner_hidden_size": 16384,
"layernorm_epsilon": 1e-05,
"mask_token_id": 130000,
"max_sequence_length": 2048,
"model_type": "chatglm",
"num_attention_heads": 32,
"num_layers": 28,
"pad_token_id": 3,
"position_encoding_2d": true,
"quantization_bit": 0,
"quantization_embeddings": false,
"torch_dtype": "float16",
"transformers_version": "4.27.1",
"use_cache": true,
"vocab_size": 130528
}

How to run fingpt on replit?

Hi everyone,

I wanted to ask how can i run fingpt on replit or locally is there any tutorial available?

Thanks

Fin GPT For indian stock market

Hi ,Thanks for the wonderful work and the report creation towards democrizing fin GPT, any plans to include FIN GPT for Indian stock market, it's quite a huge market with various test case possibilities

Datasets used in the fine-tuning process

I've noticed that while creating the dataset, the news headlines and news content were separated. This means that there are distinct training and testing sets for news headlines, as well as for news content. However, during the fine-tuning process, only the dataset containing news headlines was utilized, and the dataset with news content wasn't employed. Consequently, I'm somewhat perplexed about the role of the news content dataset in the fine-tuning process.
image
image

Encountering a bug when using add_label.py

Is your feature request related to a problem? Please describe.
Hi, I'm encountering an issue when using add_label.py. The code segment df["post_publish_time"] = pd.to_datetime(df["post_publish_time"]) is throwing an error. I checked the csv file under the 'results_with_content' folder and found that all the values of the 'post_publish_time' field are in dictionary format hence cannot be processed by the pd.to_datetime() function. What could be causing this?

csv:
image

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.