ChatGPT is a natural language processing model based on artificial neural network technology, developed by OpenAI. It can understand and generate natural language for tasks such as conversation, translation, text summarization, and more. ChatGPT is one of the most advanced natural language processing models currently. It uses a large amount of pre-training data and deep learning algorithms to achieve high-quality natural language processing capabilities.
ChatGPT is a natural language processing model based on the Transformer model. Its working principle can be divided into two stages: pre-training and fine-tuning. These two stages are introduced in detail below.
ChatGPT uses a large amount of text data for unsupervised pre-training, thereby learning the representation of natural language. In this phase, ChatGPT uses a technique called “masked language modeling” to train the model. Specifically, it randomly masks out some words in the input text, and then lets the model predict these masked words. This training method allows the model to learn the relationship between words, thereby obtaining better language representation capabilities.
After the pre-training is completed, ChatGPT can be fine-tuned to adapt to specific tasks. For example, for conversational tasks, we can fine-tune the model by giving ChatGPT some known conversation history and current responses, making it better at generating meaningful responses. In the fine-tuning phase, ChatGPT usually uses a supervised learning method, that is, using annotated data for training and updating the model parameters by optimizing the loss function. In summary, ChatGPT works by learning natural language representations through two stages of pre-training and fine-tuning, and using these representations in specific tasks to generate meaningful output.
ChatGPT is a general natural language processing model with a wide range of usage scenarios. The following are some of the main application scenarios of ChatGPT:
Hey, wait, isn’t this all nonsense? Where is it used?
It depends on your specific needs. For example, the content above this article was written by ChatGPT.
For example, I asked it to help me write a step to create a pipeline.
Isn’t this better than Baidu?
The following is a guide to build a ChatGPT that does not require scientific Internet access.
The registration steps are not complicated and mainly include the following steps:
After the account registration is completed, log in through https://platform.openai.com/.
image.png
Then click Personal to get API Keys.
Create a new Secret Key.
Write the project yourself?
impossible! Prostitution is fragrant only if it is free.
Fork the https://github.com/Chanzhaoyu/chatgpt-web project into your own warehouse.
Isn’t this pleasant?
Buy a server? install software? Install Docker?
No! ! !
The cost is too high. Here we directly use foreign deployment websites, currently the more famous ones are:
We choose raliway.app to carry out our deployment work. Visit: https://railway.app/, click Login, select Github to log in, and perform relevant authorization:
Click New Project.
Then select Deploy from Github repo.
Then select the chatgpt-web project.
Then click Deploy Now.
During the deployment process, the image will be built and you can view the specific logs.
But now the application cannot start normally because we have not configured the ChatGPT API Key, and the error is as follows:
In order to start normally, we need to add the OPENAI_API_KEY or OPENAI_ACCESS_TOKEN parameter. I use the former here, and also add a PORT parameter, the default port is 3002. In addition, I also added the AUTH_SECRET_KEY parameter, mainly to add a layer of access control to our own GPT to prevent anyone from using it.
After the addition is completed, the following is as follows:
Let’s look at the application log again. The application started successfully.
1. We can generate a random domain name in Settings, as follows:
Then you can use a random domain name to access.
#2. To use a custom domain name, the premise is that you need to prepare an available domain name yourself.
First, add a custom domain name.
Then, add a CNAME.
Then you can have a conversation.
If the main code is updated, we only need to synchronize the latest code on Github.
Then Railway will update automatically.
Railway provides a quota of 5 US dollars and 500 hours/month. When it is used up, you have to recharge or die. You can choose according to the actual situation. It is actually enough for personal use. It's nothing more than getting a few more accounts.
The above is the detailed content of Use Github and Railway to build your own ChatGPT. For more information, please follow other related articles on the PHP Chinese website!