Table of Contents
​ChatGPT
What is ChatGPT
How ChatGPT works
ChatGPT usage scenarios
Register ChatGPT
to obtain the API Token
Get the Github code
Start deployment
Create Project
Add configuration
Access
Update
About Railway
Home Technology peripherals AI Use Github and Railway to build your own ChatGPT

Use Github and Railway to build your own ChatGPT

Apr 13, 2023 pm 08:31 PM
chatgpt artificial nerve network technology

​ChatGPT

What is ChatGPT

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.

How ChatGPT works

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.

  1. Pre-training stage

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.

  1. Fine-tuning phase

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 usage scenarios

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:

  1. Dialogue system: ChatGPT can be used to build chat robots, intelligent customer service and other dialogue systems, and generate natural and smooth responses by learning a large amount of dialogue data.
  2. Machine translation: ChatGPT can be used to perform machine translation tasks, that is, automatically translating text in one language into text in another language.
  3. Text summarization: ChatGPT can be used to perform text summarization tasks, that is, to extract key information from a longer article and generate a concise summary.
  4. Question and answer system: ChatGPT can be used to build a question and answer system, that is, to answer user questions. In this scenario, ChatGPT usually needs to read and understand the input question and generate the answer through search or reasoning.
  5. Text classification: ChatGPT can be used for text classification tasks, such as sentiment analysis, spam detection, etc. In this scenario, ChatGPT needs to learn how to map text to different categories.

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.

Use Github and Railway to build your own ChatGPT

For example, I asked it to help me write a step to create a pipeline.

Use Github and Railway to build your own ChatGPT

Isn’t this better than Baidu?

The following is a guide to build a ChatGPT that does not require scientific Internet access.

Register ChatGPT

The registration steps are not complicated and mainly include the following steps:

  1. Register ChatGPT account
  2. Through SMS code receiving platform [https://sms-activate.org/](https://sms-activate.org/)Complete mobile phone verification
  3. pass[https://chat.openai.com/chat](https: //chat.openai.com/chat) Log in and use

to obtain the API Token

After the account registration is completed, log in through https://platform.openai.com/.

Use Github and Railway to build your own ChatGPT

image.png

Then click Personal to get API Keys.

Use Github and Railway to build your own ChatGPT

Create a new Secret Key.

Use Github and Railway to build your own ChatGPT

Get the Github code

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.

Use Github and Railway to build your own ChatGPT

Isn’t this pleasant?

Start deployment

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:

  • fly.io
  • render.com
  • railway.app
  • vercel.com

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:

Use Github and Railway to build your own ChatGPT

Create Project

Click New Project.

Use Github and Railway to build your own ChatGPT

Then select Deploy from Github repo.

Use Github and Railway to build your own ChatGPT

Then select the chatgpt-web project.

Use Github and Railway to build your own ChatGPT

Then click Deploy Now.

During the deployment process, the image will be built and you can view the specific logs.

Use Github and Railway to build your own ChatGPT

But now the application cannot start normally because we have not configured the ChatGPT API Key, and the error is as follows:

Use Github and Railway to build your own ChatGPT

Add configuration

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:

Use Github and Railway to build your own ChatGPT

Let’s look at the application log again. The application started successfully.

Use Github and Railway to build your own ChatGPT

Access

1. We can generate a random domain name in Settings, as follows:

Use Github and Railway to build your own ChatGPT

Then you can use a random domain name to access.

Use Github and Railway to build your own ChatGPT

#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.

Use Github and Railway to build your own ChatGPT

Then, add a CNAME.

Use Github and Railway to build your own ChatGPT

Then you can have a conversation.

Update

If the main code is updated, we only need to synchronize the latest code on Github.

Use Github and Railway to build your own ChatGPT

Then Railway will update automatically.

About Railway

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

ChatGPT now allows free users to generate images by using DALL-E 3 with a daily limit ChatGPT now allows free users to generate images by using DALL-E 3 with a daily limit Aug 09, 2024 pm 09:37 PM

DALL-E 3 was officially introduced in September of 2023 as a vastly improved model than its predecessor. It is considered one of the best AI image generators to date, capable of creating images with intricate detail. However, at launch, it was exclus

What to do if the screen resolution cannot be adjusted (it can be easily done in just a few simple steps) What to do if the screen resolution cannot be adjusted (it can be easily done in just a few simple steps) Apr 20, 2024 pm 09:56 PM

But sometimes the resolution of our mobile phones will change with the resolution, and the parameters will become more and more precise. Now the configuration of mobile phones is constantly improving, so what should I do if the resolution of mobile phones cannot be adjusted? The resolution of mobile phone screens is also improving? Let’s take a look below! What should I do if I can’t adjust the resolution of my phone? The method is to enter the settings. It is also possible for other mobile phones. It is recommended to adjust it in the software settings. If the phone resolution follows the requirements, adjust "More" in the settings, then scroll down and find, click "Display" and enter the options. "display resolution". After clicking and finally clicking, a window showing the resolution will pop up. The size can be adjusted to the screen resolution you need. Just click "OK". You can also click "Automatically adjust resolution" to watch for a long time

What is the current mobile live broadcast sound card (cost-effective mobile phone sound card) What is the current mobile live broadcast sound card (cost-effective mobile phone sound card) Apr 07, 2024 pm 07:43 PM

Although there are many types of sound cards on the market, their quality and effects vary. Live broadcast sound cards are a must-have for anchors. This article will introduce you from multiple angles to how to choose a live broadcast sound card that suits you. 1. A comprehensive sound card. First of all, you need a sound card with comprehensive functions and excellent quality. If you want to have an excellent live broadcast sound card. Such as XXX, YYY, etc., there are many brands of sound card products on the market. Choose the right brand and model according to your budget and needs. 2. Understand different types of sound cards. It is important to understand different types of sound cards before purchasing a sound card. There are three common types on the market: passive, all-in-one, and active. Suitable for anchors with limited budget or personal use, the active sound card has the ability to record rich sound effects.

Honor 10 frequently freezes and restarts after upgrading to Hongmeng (How to restart Huawei mobile phones) Honor 10 frequently freezes and restarts after upgrading to Hongmeng (How to restart Huawei mobile phones) Apr 23, 2024 pm 06:30 PM

And it also brings different choices to consumers in terms of price. After more than half a year of hot sales, Honor mobile phones have become more outstanding with their own cost performance, and they also have many excellent models in the domestic mobile phone market. Next I would like to share with you “10 Restart Tips” to make your phone run more smoothly and stably. Let’s take a look together. Tips: The phone is stuck and slow to respond. Open the phone's settings. In fact, the phone is stuck and slow to respond. It may be caused by our daily use - system - and then select the processor settings as no more than 3 months, developer options. Tips: Mobile phone software consumes battery power quickly because of the use of some unnecessary self-starting applications in the phone. Many people think that this phenomenon is not worth it for us, so close unnecessary self-starting applications in the phone.

Current mobile phone processor ranking Android (current performance mobile phones) Current mobile phone processor ranking Android (current performance mobile phones) Apr 07, 2024 pm 07:37 PM

It is very important for daily use of mobile phones. Whether it is used for playing games, it is the main factor that directly determines the performance of a mobile phone. The processor is the main factor that directly determines the performance of a mobile phone when we use it daily. In the current market, the most powerful mobile phone processor is undoubtedly the Qualcomm Snapdragon 870 processor, which is almost unrivaled. This processor is currently the most powerful processor. This content shows that the Snapdragon 870 processor is one of the current processors in the Android camp and has powerful performance. In the current mobile phone market, its storage and natural performance are no less than the Snapdragon 888 processor. It has 12GB/256GB/512GB storage version, supports LPDDR5 high-speed memory, the GPU is Adreno650, and uses 4 CortexA77

Nokia n900 automatically starts the camera to take pictures (how to use the Nokia camera function) Nokia n900 automatically starts the camera to take pictures (how to use the Nokia camera function) Apr 10, 2024 pm 04:13 PM

It has really increased our burden. Whether commuting to work or taking a mobile phone out with us at work, today's mobile phones have become an indispensable tool in our lives. Then the mobile phone becomes a serious problem, so suddenly there is no camera to take pictures. We have to import the photos from the mobile phone to the computer to save them. Sometimes when we go out to play. Today I will teach you how to import photos to your computer using your Nokia n900 mobile phone. It is very convenient. It can help us import the camera's photo program directly into the computer, eliminating the need to use the camera. It comes with a very easy-to-use function. Our Nokia N900 mobile phone is the same as the current mainstream mobile phones, called NEW Plug-in! The following uses Xiaomi mobile phone as an example to demonstrate the operation, as shown below:

Which Android phone to use currently (recommended 2024 Android flagship phone) Which Android phone to use currently (recommended 2024 Android flagship phone) Apr 06, 2024 pm 05:01 PM

Android phones are becoming more and more powerful in the market with the continuous advancement of technology. To satisfy consumers' pursuit of performance and functionality, major manufacturers have launched their own flagship mobile phones. In terms of design and user experience, which phones stand out among the many Android flagship phones and can perform well? We will recommend five high-performance Android flagship phones for you next. 1. Huawei Mate50Pro: With super performance and excellent shooting capabilities, equipped with an excellent screen and camera, and equipped with a powerful Kirin 9000 processor, Huawei Mate50Pro can be said to be excellent in terms of hardware configuration. It also supports 5G network connection, allowing users to enjoy high-speed communication and smooth gaming experience. It not only has high resolution and excellent camera capabilities.

SearchGPT: Open AI takes on Google with its own AI search engine SearchGPT: Open AI takes on Google with its own AI search engine Jul 30, 2024 am 09:58 AM

Open AI is finally making its foray into search. The San Francisco company has recently announced a new AI tool with search capabilities. First reported by The Information in February this year, the new tool is aptly called SearchGPT and features a c

See all articles