AI4Finance-Foundation / FinGPT

FinGPT: Open-Source Financial Large Language Models! Revolutionize 🔥 We release the trained model on HuggingFace.
https://ai4finance.org
MIT License
13.84k stars 1.92k forks source link

chatgpt-trading-v2\trade_with_gpt3.ipynb run error #7

Closed lichao252244354 closed 1 year ago

lichao252244354 commented 1 year ago

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

oliverwang15 commented 1 year ago

你好,lichao。这是因为这个demo中仅有GPT-3对于AAPL这只股票的分析结果是我们预先提供的,如果您需要其他股票的结果可以将agent_args中的source参数改为”openai“,同时将/demos/chatgpt-trading-v2/openai_token/token_.py中的OPEN_AI_TOKEN换成您自己的openai token,此时运行会调用openai的gpt-3模型的api,具体价格请参考openai官网。同时,由于网络不稳定因素可能导致调用过程报错影响程序运行,可以仿照demos/chatgpt-trading-v2/get_gpt_sentiment_results文件下的代码先将情感分析结果预先保存下来在进行后续计算。

Hello, lichao. This is because only GPT-3 analysis results for the stock AAPL in this demo are provided by us in advance. If you need other stock results, you can change the source parameter in agent_args to openai. At the same time, replace OPEN_AI_TOKEN in /demos/chatgpt-trading-v2/openai_token/token_.py with your own openai token. Running this will call openai's gpt-3 model api. Please refer to the official website of openai for the specific price. At the same time, due to network instability factors that may cause errors in the calling process and affect the program operation, you can copy the code in the demos/chatgpt-trading-v2/get_gpt_sentiment_results file to save the sentiment analysis results in advance for subsequent calculation.

lichao252244354 commented 1 year ago

好的,谢谢, 我在运行时确实会有网络问题引起,代理有时候不稳定

EricaSilas commented 1 year ago

谢谢

elven2016 commented 1 year ago

你好,lichao。这是因为这个demo中仅有GPT-3对于AAPL这只股票的分析结果是我们预先提供的,如果您需要其他股票的结果可以将agent_args中的source参数改为”openai“,同时将/demos/chatgpt-trading-v2/openai_token/token_.py中的OPEN_AI_TOKEN换成您自己的openai token,此时运行会调用openai的gpt-3模型的api,具体价格请参考openai官网。同时,由于网络不稳定因素可能导致调用过程报错影响程序运行,可以仿照demos/chatgpt-trading-v2/get_gpt_sentiment_results文件下的代码先将情感分析结果预先保存下来在进行后续计算。

Hello, lichao. This is because only GPT-3 analysis results for the stock AAPL in this demo are provided by us in advance. If you need other stock results, you can change the source parameter in agent_args to openai. At the same time, replace OPEN_AI_TOKEN in /demos/chatgpt-trading-v2/openai_token/token_.py with your own openai token. Running this will call openai's gpt-3 model api. Please refer to the official website of openai for the specific price. At the same time, due to network instability factors that may cause errors in the calling process and affect the program operation, you can copy the code in the demos/chatgpt-trading-v2/get_gpt_sentiment_results file to save the sentiment analysis results in advance for subsequent calculation.

你好 df.csv文件是怎么获取的,demo里面是不是只有aapl的数据啊,需要先对tweet下面的stock code的所有数据进行处理来获取吗?