gpt-academic / docs /README.English.md
qingxu98's picture
update gr
47289f8
|
raw
history blame
24.1 kB

Note

This README was translated by GPT (implemented by the plugin of this project) and may not be 100% reliable. Please carefully check the translation results.

2023.11.7: When installing dependencies, please select the specified versions in the requirements.txt file. Installation command: pip install -r requirements.txt.

GPT Academic Optimization

If you like this project, please give it a Star. To translate this project to arbitrary language with GPT, read and run multi_language.py (experimental).

Note

1.Please note that only plugins (buttons) highlighted in bold support reading files, and some plugins are located in the dropdown menu in the plugin area. Additionally, we welcome and process any new plugins with the highest priority through PRs.

2.The functionalities of each file in this project are described in detail in the self-analysis report self_analysis.md. As the version iterates, you can also click on the relevant function plugin at any time to call GPT to regenerate the project's self-analysis report. Common questions are in the wiki. Regular installation method | One-click installation script | Configuration instructions.

3.This project is compatible with and encourages the use of domestic large-scale language models such as ChatGLM. Multiple api-keys can be used together. You can fill in the configuration file with API_KEY="openai-key1,openai-key2,azure-key3,api2d-key4" to temporarily switch API_KEY during input, enter the temporary API_KEY, and then press enter to apply it.

Feature (⭐ = Recently Added) Description
Integrate New Models Baidu Qianfan and Wenxin Yiyu, Tongyi Qianwen, Shanghai AI-Lab Shusheng, Xunfei Xinghuo, LLaMa2, Zhifu API, DALLE3
Proofreading, Translation, Code Explanation One-click proofreading, translation, searching for grammar errors in papers, explaining code
Custom Shortcuts Support for custom shortcuts
Modular Design Support for powerful plugins, plugins support hot updates
Program Profiling [Plugin] One-click to profile Python/C/C++/Java/Lua/... project trees or self-profiling
Read Papers, Translate Papers [Plugin] One-click to interpret full-text latex/pdf papers and generate abstracts
Full-text Latex Translation, Proofreading [Plugin] One-click translation or proofreading of latex papers
Batch Comment Generation [Plugin] One-click batch generation of function comments
Markdown Translation [Plugin] Did you see the README in the top five languages?
Chat Analysis Report Generation [Plugin] Automatically generates summary reports after running
PDF Paper Full-text Translation [Plugin] Extract title & abstract of PDF papers + translate full-text (multi-threaded)
Arxiv Helper [Plugin] Enter the arxiv article URL to translate the abstract + download PDF with one click
One-click Proofreading of Latex Papers [Plugin] Syntax and spelling correction of Latex papers similar to Grammarly + output side-by-side PDF
Google Scholar Integration Helper [Plugin] Given any Google Scholar search page URL, let GPT help you write related works
Internet Information Aggregation + GPT [Plugin] One-click to let GPT retrieve information from the Internet to answer questions and keep the information up to date
⭐Arxiv Paper Fine Translation (Docker) [Plugin] One-click high-quality translation of arxiv papers, the best paper translation tool at present
Real-time Speech Input [Plugin] Asynchronously listen to audio, automatically segment sentences, and automatically find the best time to answer
Formula/Image/Table Display Can simultaneously display formulas in TeX form and rendered form, support formula and code highlighting
⭐AutoGen Multi-Agent Plugin [Plugin] Explore the emergence of multi-agent intelligence with Microsoft AutoGen!
Start Dark Theme Add /?__theme=dark to the end of the browser URL to switch to the dark theme
More LLM Model Support It must be great to be served by GPT3.5, GPT4, THU ChatGLM2, and Fudan MOSS at the same time, right?
⭐ChatGLM2 Fine-tuning Model Support for loading ChatGLM2 fine-tuning models and providing ChatGLM2 fine-tuning assistant plugins
More LLM Model Access, support for huggingface deployment Join NewBing interface (New Bing), introduce Tsinghua JittorLLMs to support LLaMA and Pangu
void-terminal pip package Use this project's all function plugins directly in Python without GUI (under development)
⭐Void Terminal Plugin [Plugin] Schedule other plugins of this project directly in natural language
More New Feature Demonstrations (Image Generation, etc.)...... See the end of this document ........
  • New interface (modify the LAYOUT option in config.py to switch between "left-right layout" and "top-bottom layout")

  • All buttons are dynamically generated by reading functional.py and can be added with custom functions to free up the clipboard

  • Proofreading/Correction

  • If the output contains formulas, they will be displayed in both tex format and rendered format for easy copying and reading.

  • Too lazy to look at the project code? Show off the whole project directly in chatgpt's mouth

  • Multiple large language models mixed calling (ChatGLM + OpenAI-GPT3.5 + API2D-GPT4)

Installation

Installation Method I: Run directly (Windows, Linux or MacOS)

  1. Download the project
git clone --depth=1 https://github.com/binary-husky/gpt_academic.git
cd gpt_academic
  1. Configure API_KEY

In config.py, configure API KEY and other settings, click here to see special network environment configuration methods. Wiki page

「 The program will first check if a secret configuration file named config_private.py exists and use the configurations from that file to override the ones in config.py with the same names. If you understand this logic, we strongly recommend that you create a new configuration file named config_private.py next to config.py and move (copy) the configurations from config.py to config_private.py (only copy the configuration items you have modified). 」

「 Project configuration can be done via environment variables. The format of the environment variables can be found in the docker-compose.yml file or our Wiki page. Configuration priority: environment variables > config_private.py > config.py. 」

  1. Install dependencies
# (Option I: If you are familiar with python, python>=3.9) Note: Use the official pip source or the Aliyun pip source. Temporary method for switching the source: python -m pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
python -m pip install -r requirements.txt

# (Option II: Using Anaconda) The steps are similar (https://www.bilibili.com/video/BV1rc411W7Dr):
conda create -n gptac_venv python=3.11    # Create the anaconda environment
conda activate gptac_venv                 # Activate the anaconda environment
python -m pip install -r requirements.txt # This step is the same as the pip installation process
If you need to support THU ChatGLM2, Fudan MOSS, or RWKV Runner as backends, click here to expand

【Optional Step】If you need to support THU ChatGLM2 or Fudan MOSS as backends, you need to install additional dependencies (Prerequisites: Familiar with Python + Familiar with Pytorch + Sufficient computer configuration):

# 【Optional Step I】Support THU ChatGLM2. Note: If you encounter the "Call ChatGLM fail unable to load ChatGLM parameters" error, refer to the following: 1. The default installation above is for torch+cpu version. To use cuda, uninstall torch and reinstall torch+cuda; 2. If the model cannot be loaded due to insufficient local configuration, you can modify the model accuracy in request_llm/bridge_chatglm.py. Change AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True) to AutoTokenizer.from_pretrained("THUDM/chatglm-6b-int4", trust_remote_code=True)
python -m pip install -r request_llms/requirements_chatglm.txt

# 【Optional Step II】Support Fudan MOSS
python -m pip install -r request_llms/requirements_moss.txt
git clone --depth=1 https://github.com/OpenLMLab/MOSS.git request_llms/moss  # When executing this line of code, make sure you are in the root directory of the project

# 【Optional Step III】Support RWKV Runner
Refer to wiki: https://github.com/binary-husky/gpt_academic/wiki/%E9%80%82%E9%85%8DRWKV-Runner

# 【Optional Step IV】Make sure that the AVAIL_LLM_MODELS in the config.py configuration file includes the expected models. The currently supported models are as follows (jittorllms series currently only supports the docker solution):
AVAIL_LLM_MODELS = ["gpt-3.5-turbo", "api2d-gpt-3.5-turbo", "gpt-4", "api2d-gpt-4", "chatglm", "moss"] # + ["jittorllms_rwkv", "jittorllms_pangualpha", "jittorllms_llama"]

  1. Run
python main.py

Installation Method II: Use Docker

  1. Deploy all capabilities of the project (this is a large image that includes cuda and latex. Not recommended if you have slow internet speed or small hard drive) fullcapacity
# Modify docker-compose.yml, keep scheme 0 and delete other schemes. Then run:
docker-compose up
  1. ChatGPT + Wenxin + Spark online models only (recommended for most people) basic basiclatex basicaudio
# Modify docker-compose.yml, keep scheme 1 and delete other schemes. Then run:
docker-compose up

P.S. If you need the latex plugin functionality, please see the Wiki. Also, you can directly use scheme 4 or scheme 0 to get the Latex functionality.

  1. ChatGPT + ChatGLM2 + MOSS + LLAMA2 + Intelligent Questions (requires familiarity with Nvidia Docker runtime) chatglm
# Modify docker-compose.yml, keep scheme 2 and delete other schemes. Then run:
docker-compose up

Installation Method III: Other deployment methods

  1. Windows one-click running script. Windows users who are completely unfamiliar with the python environment can download the one-click running script from the Release to install the version without local models. The script is contributed by oobabooga.

  2. Use third-party APIs, Azure, Wenxin, Xinghuo, etc., see Wiki page

  3. Pitfall guide for deploying on cloud servers. Please visit Cloud Server Remote Deployment Wiki

  4. Some new deployment platforms or methods

Advanced Usage

I: Customizing new convenient buttons (academic shortcuts)

Open core_functional.py with any text editor, add the following entry, and then restart the program. (If the button already exists, both the prefix and suffix can be modified on-the-fly without restarting the program.) For example:

"Super Translation": {
    # Prefix: will be added before your input. For example, used to describe your request, such as translation, code explanation, proofreading, etc.
    "Prefix": "Please translate the following paragraph into Chinese and then explain each proprietary term in the text using a markdown table:\n\n",

    # Suffix: will be added after your input. For example, used to wrap your input in quotation marks along with the prefix.
    "Suffix": "",
},

II: Custom function plugins

Write powerful function plugins to perform any task you desire and can't imagine. The difficulty of writing and debugging plugins in this project is very low. As long as you have a certain knowledge of Python, you can implement your own plugin functionality by following the template we provide. For more details, please refer to the Function Plugin Guide.

Updates

I: Dynamics

  1. Conversation-saving feature. Call Save the current conversation in the function plugin area to save the current conversation as a readable and restorable HTML file. Additionally, call Load conversation history archive in the function plugin area (drop-down menu) to restore previous sessions. Tip: Clicking Load conversation history archive without specifying a file allows you to view the cached historical HTML archive.

  2. ⭐Latex/Arxiv paper translation feature⭐

    ===>
  3. Void Terminal (understanding user intent from natural language input and automatically calling other plugins)

  1. Modular function design, simple interface supporting powerful functionality

  2. Translate and interpret other open-source projects

  3. Added small features that decorate live2d (disabled by default, needs modification in config.py)

  4. OpenAI image generation

  5. OpenAI audio parsing and summarization

  6. Latex full-text proofreading and correction

    ===>
  7. Language and theme switching

II: Versions:

  • version 3.70 (todo): Optimize the AutoGen plugin theme and design a series of derivative plugins
  • version 3.60: Introduce AutoGen as the cornerstone of the new generation of plugins
  • version 3.57: Support GLM3, Spark v3, Wenxin Quote v4, and fix concurrency bugs in local models
  • version 3.56: Support dynamically adding basic functional buttons and a new summary PDF page
  • version 3.55: Refactor the frontend interface and introduce floating windows and a menu bar
  • version 3.54: Add a dynamic code interpreter (Code Interpreter) (to be improved)
  • version 3.53: Support dynamically choosing different interface themes, improve stability, and resolve conflicts between multiple users
  • version 3.50: Use natural language to call all function plugins of this project (Void Terminal), support plugin classification, improve UI, and design new themes
  • version 3.49: Support Baidu Qianfan Platform and Wenxin Quote
  • version 3.48: Support Ali Dharma Academy Tongyi Qianwen, Shanghai AI-Lab Shusheng, and Xunfei Spark
  • version 3.46: Support fully hands-off real-time voice conversation
  • version 3.45: Support customizing ChatGLM2 fine-tuned models
  • version 3.44: Officially support Azure, optimize interface usability
  • version 3.4: + Arxiv paper translation, latex paper correction functionality
  • version 3.3: + Internet information integration functionality
  • version 3.2: Function plugins support more parameter interfaces (conversation saving functionality, interpreting any code language + asking any combination of LLMs simultaneously)
  • version 3.1: Support querying multiple GPT models simultaneously! Support API2D, support load balancing for multiple API keys
  • version 3.0: Support chatglm and other small-scale LLMs
  • version 2.6: Refactored plugin structure, improved interactivity, added more plugins
  • version 2.5: Self-updating, fix the problem of text being too long and token overflowing when summarizing large code projects
  • version 2.4: (1) Add PDF full-text translation functionality; (2) Add functionality to switch the position of the input area; (3) Add vertical layout option; (4) Optimize multi-threaded function plugins.
  • version 2.3: Enhance multi-threaded interactivity
  • version 2.2: Function plugin hot-reloading support
  • version 2.1: Collapsible layout
  • version 2.0: Introduce modular function plugins
  • version 1.0: Basic functionality

GPT Academic Developer QQ Group: 610599535

  • Known Issues
    • Some browser translation plugins interfere with the frontend operation of this software
    • Official Gradio currently has many compatibility bugs, please make sure to install Gradio using requirement.txt

III: Themes

You can change the theme by modifying the THEME option (config.py).

  1. Chuanhu-Small-and-Beautiful Website

IV: Development Branches of This Project

  1. master branch: Main branch, stable version
  2. frontier branch: Development branch, test version

V: References and Learning

The code references the designs of many other excellent projects, in no particular order:

THU ChatGLM2-6B

THU JittorLLMs

ChatPaper

Edge-GPT

ChuanhuChatGPT

Oobabooga one-click installer:

https://github.com/oobabooga/one-click-installers

More:

https://github.com/gradio-app/gradio https://github.com/fghrsh/live2d_demo