반응형
How to Build Your Own AI Chatbot With ChatGPT API: A Step-by-Step Tutorial – Beebom
ChatGPT API를 사용하여 자신만의 AI 챗봇을 구축하는 방법: 단계별 튜토리얼 – Beebom By Josh Durso - December 8, 2023 In a breakthrough announcement, OpenAI recently introduced the ChatGPT API to developers and the public. Particularly, the new “gpt-3.5-turbo” model, which powers ChatGPT Plus has been released at a 10x cheaper price, and it’s extremely responsive as well. Basically, OpenAI has opened the door for endless possibilities and even a non-coder can implement the new ChatGPT API and create their own AI chatbot. So in this article, we bring you a tutorial on how to build your own AI chatbot using the ChatGPT API. We have also implemented a Gradio interface so you can easily demo the AI model and share it with your friends and family. On that note, let’s go ahead and learn how to create a personalized AI with ChatGPT API. 획기적 발표로 OpenAI는 최근 개발자와 대중에게 ChatGPT API를 도입했습니다. 특히, ChatGPT Plus를 구동하는 새로운 "gpt-3.5-turbo" 모델은 10배 저렴한 가격으로 출시되었으며 반응성도 매우 뛰어납니다. 기본적으로 OpenAI는 무한한 가능성의 문을 열었으며 코더가 아닌 사람이라도 새로운 ChatGPT API를 구현하고 자신만의 AI 챗봇을 만들 수 있습니다. 그래서 이 글에서는 ChatGPT API를 사용하여 자신만의 AI 챗봇을 구축하는 방법에 대한 튜토리얼을 제공합니다. 또한 Gradio 인터페이스를 구현하여 AI 모델을 쉽게 시연하고 친구 및 가족과 공유할 수 있습니다. 그런 의미에서 ChatGPT API를 사용하여 개인화된 AI를 만드는 방법을 알아보겠습니다. Build Your Own Chatbot With ChatGPT API (2023) ChatGPT API를 사용한 나만의 챗봇 구축 이 튜토리얼에서는 ChatGPT API를 사용하여 자신만의 AI 챗봇을 구축하기 위한 단계별 지침을 추가했습니다. 도구설정부터 라이브러리설치, 마지막으로 처음부터 AI챗봇 만들기까지 일반사용자를 위한 소소한 내용을 모두 여기에 담았습니다. 어떤 부분도 건너뛰지 않고 모든 지침을 따르는 것이 좋습니다. In this tutorial, we have added step-by-step instructions to build your own AI chatbot with ChatGPT API. From setting up tools to installing libraries, and finally, creating the AI chatbot from scratch, we have included all the small details for general users here. We recommend you follow the instructions from top to bottom without skipping any part. Table of Contents 목차
Things to Remember Before You Build an AI Chatbot AI 챗봇을 구축하기 전에 기억해야 할 사항 1. Windows, macOS, Linux, ChromeOS 등 모든 플랫폼에서 ChatGPT 챗봇을 구축할 수 있습니다. 이 문서에서는 Windows 11을 사용하고 있지만 다른 플랫폼에서도 단계는 거의 동일합니다. You can build a ChatGPT chatbot on any platform, whether Windows, macOS, Linux, or ChromeOS. In this article, I am using Windows 11, but the steps are nearly identical for other platforms. 2. 이 가이드는 일반사용자를 대상으로 하며, 예를 들어 설명이 명확하게 설명되어 있습니다. 그래서 컴퓨터에 대한 지식이 조금이라도 있어도 나만의 AI 챗봇을 쉽게 만들 수 있습니다. The guide is meant for general users, and the instructions are clearly explained with examples. So even if you have a cursory knowledge of computers, you can easily create your own AI chatbot. 3. AI 챗봇을 만들려면 강력한 CPU나 GPU를 갖춘 강력한 컴퓨터가 필요하지 않습니다. 무거운 작업은 클라우드에서 OpenAI의 API를 통해 수행됩니다. To create an AI chatbot, you don’t need a powerful computer with a beefy CPU or GPU. The heavy lifting is done by OpenAI’s API on the cloud. ChatGPT로 구동되는 AI 챗봇을 만들기 전에 환경을 설정하는 데 필요한 몇 가지 도구가 있습니다. 간단히 추가하려면 Python, Pip, OpenAI 및 Gradio 라이브러리, OpenAI API 키, Notepad++ 같은 코드 편집기가 필요합니다. 이러한 모든 도구는 처음에는 어려워 보일 수 있지만 단계가 쉽고 누구나 배포할 수 있습니다. 이제 아래 단계를 따르십시오.. There are a couple of tools you need to set up the environment before you can create an AI chatbot powered by ChatGPT. To briefly add, you will need Python, Pip, OpenAI, and Gradio libraries, an OpenAI API key, and a code editor like Notepad++. All these tools may seem intimidating at first, but believe me, the steps are easy and can be deployed by anyone. Now, follow the below steps. Install Python 1. 먼저 컴퓨터에 Python을 설치해야 합니다. this link 를 열고 플랫폼에 맞는 설치 파일을 다운로드하세요. First, you need to install Python on your computer. Open this link and download the setup file for your platform. 위 화면에서 Download Python 3.12.1을 클릭하면 Python 3.12.1 버전이 다운로드됩니다. 다운로드된 파일을 클릭합니다. 2. 그런 다음 “Install Now 지금 설치"를 클릭하고 일반적 단계에 따라 Python을 설치하십시오. After that, click on “Install Now” and follow the usual steps to install Python. “Install Now"를 클릭하기 전에, 위 화면에 있는 “Add Python.exe to PATH” checkbox 를 활성화해야 하는데, 이것은 매우 중요한 단계입니다. Next, run the setup file and make sure to enable the checkbox for “Add Python.exe to PATH.” This is an extremely important step. 위 화면처럼 Python 3.12.1 Install이 완료됩니다. 3. Python이 제대로 설치되었는지 확인하려면 컴퓨터에서 터미널을 엽니다. 저는 Windows 11에서 Windows 터미널을 사용하고 있는데 명령 프롬프트를 사용할 수도 있습니다. To check if Python is properly installed, open Terminal on your computer. I am using Windows Terminal on Windows, but you can also use Command Prompt. 위 명령 프롬프트는 화면 왼쪽 아래 검색 창에 명령 프로프트를 입력하면 위 화면으로 갈 수 있습니다. 여기에서 아래 명령을 실행하면 Python 버전이 출력됩니다. python --version Linux 또는 기타 플랫폼에서는 python --version 대신 python3 --version을 사용해야 할 수도 있습니다. Once here, run the below command below, and it will output the Python version. On Linux or other platforms, you may have to use python3 --version instead of python --version. Upgrade Pip 업그레이드 하기 Python과 함께 Pip도 시스템에 동시에 설치됩니다. 이 섹션에서는 최신 버전으로 업그레이드하는 방법을 알아봅니다. Pip은 Python의 패키지 관리자입니다. 기본적으로 터미널에서 수천 개의 Python 라이브러리를 설치할 수 있습니다. Pip을 사용, OpenAI 및 Gradio 라이브러리를 설치할 수 있습니다. 이에 대한 방법은 다음과 같습니다. PC에서 원하는 터미널을 엽니다. 저는 Windows 터미널을 사용하고 있습니다. 이제 아래 명령을 실행하여 Pip을 업데이트하십시오. Along with Python, Pip is also installed simultaneously on your system. In this section, we will learn how to upgrade it to the latest version. In case you don’t know, Pip is the package manager for Python. Basically, it enables you to install thousands of Python libraries from the Terminal. With Pip, we can install OpenAI and Gradio libraries. Here is how to go about it. Open the Terminal of your choice on your PC. As for me, I’m using the Windows Terminal. Now, run the below command to update Pip. python -m pip install -U pip 다시 말하지만, Linux나 다른 플랫폼에서는 python3과 pip3을 사용해야 할 수도 있습니다. Again, you may have to use python3 and pip3 on Linux or other platforms. https://amzn.to/3tfFpPU Install OpenAI and Gradio Libraries 라이브러리 설치하기 이제 API를 통해 ChatGPT와 상호작용할 수 있는 OpenAI 라이브러리를 설치할 차례입니다. 터미널에서 아래 명령을 실행하여 Pip을 사용하여 OpenAI 라이브러리를 설치합니다. 명령이 작동하지 않으면 pip3으로 실행해 보십시오. Now, it’s time to install the OpenAI library, which will allow us to interact with ChatGPT through their API. In the Terminal, run the below command to install the OpenAI library using Pip. If the command does not work, try running it with pip3. pip install openai 설치가 완료되면 Gradio를 설치해보겠습니다. Gradio를 사용하면 AI 챗봇을 시연할 수 있도록 친숙한 웹 인터페이스를 빠르게 개발할 수 있습니다. 또한 공유가능 링크를 통해 인터넷에서 챗봇을 쉽게 공유할 수 있습니다. After the installation is done, let’s install Gradio. Gradio allows you to quickly develop a friendly web interface so that you can demo your AI chatbot. It also lets you easily share the chatbot on the internet through a shareable link. pip install gradio 다운로드 하는 양이 많아서 시간이 좀 걸립니다. Download a Code Editor 마지막으로 일부 코드를 편집하려면 코드편집기가 필요합니다. Windows에서는 Notepad++ (Download)를 권장합니다. 첨부된 링크를 통해 프로그램을 다운로드하여 설치하면 됩니다. Finally, we need a code editor to edit some of the code. On Windows, I would recommend Notepad++ (Download). Simply download and install the program via the attached link. 강력한 IDE에 익숙하다면 모든 플랫폼에서 VS Code를 사용할 수도 있습니다. VS Code 외에, macOS 및 Linux에 Sublime Text (Download)를 설치할 수 있습니다. ChromeOS의 경우, 탁월한 Caret app (Download)을 사용하여 코드를 편집할 수 있습니다. You can also use VS Code on any platform if you are comfortable with powerful IDEs. Other than VS Code, you can install Sublime Text (Download) on macOS and Linux. For ChromeOS, you can use the excellent Caret app (Download) to edit the code. 소프트웨어 환경설정이 거의 완료되었으며 이제 OpenAI API 키를 얻을 차례입니다. 이제 ChatGPT 기반 AI 챗봇을 만들려면 OpenAI의 API 키가 필요합니다. API 키를 사용하면 자체 인터페이스에서 ChatGPT를 호출하고 결과를 바로 표시할 수 있습니다. 현재 OpenAI는 처음 3개월 동안 5달러 상당의 무료 크레딧과 함께 무료 API 키를 제공하고 있습니다. 이전에 OpenAI 계정을 만든 경우 $18 상당의 무료 크레딧을 받을 수 있습니다. 무료 크레딧이 소진된 후에는 API 액세스 비용을 지불해야 합니다. 그러나 현재로서는 모든 사용자가 무료로 사용할 수 있습니다. We are almost done setting up the software environment, and it’s time to get the OpenAI API key. Now, to create a ChatGPT-powered AI chatbot, you need an API key from OpenAI. The API key will allow you to call ChatGPT in your own interface and display the results right there. Currently, OpenAI is offering free API keys with $5 worth of free credit for the first three months. If you created your OpenAI account earlier, you may have free credit worth $18. After the free credit is exhausted, you will have to pay for the API access. But for now, it’s available to all free users. 1. platform.openai.com/signup으로 이동하여 무료 계정을 만드세요. 이미 OpenAI 계정이 있는 경우 간단히 로그인하세요. Head to platform.openai.com/signup and create a free account. If you already have an OpenAI account, simply log in. 2. 그런 다음 오른쪽 상단에 있는 프로필을 클릭하고 드롭다운 메뉴에서 "View API keys"를 선택하세요. Next, click on your profile in the top-right corner and select “View API keys” from the drop-down menu. 3. 여기에서 '새 비밀 키 만들기 Create new secret key'를 클릭하고 API 키를 복사하세요. 나중에 전체 API 키를 복사하거나 볼 수 없다는 점에 유의하세요. 따라서 API 키를 즉시 메모장 파일에 복사하여 붙여넣는 것이 좋습니다. Here, click on “Create new secret key” and copy the API key. Do note that you can’t copy or view the entire API key later on. So it’s strongly recommended to copy and paste the API key to a Notepad file immediately. 4. 또한 API 키를 공개적으로 공유하거나 표시하지 마십시오. 이는 귀하의 계정에 액세스하기 위한 전용 키입니다. API 키를 삭제하고 여러 개인 키(최대 5개)를 생성할 수도 있습니다. 마지막으로 AI 챗봇을 배포할 차례입니다. 이를 위해 우리는 GPT-3.5를 지원하는 OpenAI의 최신 "gpt-3.5-turbo" 모델을 사용하고 있습니다. Davinci보다 훨씬 더 강력하며 2021.9월까지 훈련되었습니다. 또한 비용효율적이고 이전모델보다 반응성이 뛰어나며 대화의 맥락을 기억합니다. 사용자 인터페이스에 관해서는 Gradio를 사용하여 로컬과 웹 모두에서 사용할 수 있는 간단한 웹인터페이스를 만들고 있습니다. Also, do not share or display the API key in public. It’s a private key meant only for access to your account. You can also delete API keys and create multiple private keys (up to five). Finally, it’s time to deploy the AI chatbot. For this, we are using OpenAI’s latest “gpt-3.5-turbo” model, which powers GPT-3.5. It’s even more powerful than Davinci and has been trained up to September 2021. It’s also very cost-effective, more responsive than earlier models, and remembers the context of the conversation. As for the user interface, we are using Gradio to create a simple web interface that will be available both locally and on the web. 1. 먼저 open Notepad++ (Notepad++(또는 선택한 코드편집기) 열기) 하고 아래 코드를 붙여넣습니다. GitHub의 armrrs 덕분에 코드의 용도를 변경하고 Gradio 인터페이스도 구현했습니다. First, (or your choice of code editor) and paste the below code. Thanks to armrrs on GitHub, I have repurposed his code and implemented the Gradio interface as well. import openai import gradio as gr openai.api_key = "Your API key" messages = [ {"role": "system", "content": "You are a helpful and kind AI Assistant."}, ] def chatbot(input): if input: messages.append({"role": "user", "content": input}) chat = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=messages ) reply = chat.choices[0].message.content messages.append({"role": "assistant", "content": reply}) return reply inputs = gr.inputs.Textbox(lines=7, label="Chat with AI") outputs = gr.outputs.Textbox(label="Reply") gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Chatbot", description="Ask anything you want", theme="compact").launch(share=True) 2. 코드 편집기에서는 다음과 같이 표시됩니다. "Your API key" 텍스트를 위에서 생성된 고유한 API키로 바꾸십시오. 그것이 당신이 해야 할 유일한 변화입니다. This is how it looks in the code editor. Make sure to replace the “Your API key” text with your own API key generated above. That’s the only change you have to make. 3. 그런 다음 상단 메뉴에서 “File”을 클릭하고 드롭다운 메뉴에서 “Save As…”을 선택합니다. Next, click on “File” in the top menu and select “Save As…” from the drop-down menu. 4. 그런 다음 파일 이름을 "app.py"로 설정하고 드롭다운 메뉴에서 "Save as type”을 "All types"으로 변경합니다. 그런 다음 데스크탑과 같이 쉽게 액세스할 수 있는 위치에 파일을 저장합니다. 원하는 대로 이름을 바꿀 수 있지만 .py가 추가되었는지 확인하세요. After that, set the file name as “app.py” and change “Save as type” to “All types” from the drop-down menu. Then, save the file to an easily-accessible location like the Desktop. You can change the name to your preference, but make sure .py is appended. 5. 이제 파일을 저장한 위치(app.py)로 이동. 마우스 오른쪽 버튼을 클릭하고 “Copy as path“.를 선택. Now, move to the location where you saved the file (app.py). Right-click on it and choose “Copy as path“. 6. 터미널을 열고 아래 명령을 실행. Python을 입력하고 공백 추가한 후 경로를 붙여넣고 paste the path(빠르게 붙여넣으려면 마우스 오른쪽 버튼을 클릭) Enter 키를 누르세요. 컴퓨터에 따라 파일 경로가 다를 수 있다는 점에 유의하세요. 또한 Linux 시스템에서는 python3을 사용해야 할 수도 있습니다. Open the Terminal and run the below command. Simply enter python, add a space, paste the path (right-click to quickly paste), and hit Enter. Keep in mind, the file path will be different for your computer. Also, on Linux systems, you may have to use python3. python "C:UsersmearjDesktopapp.py" 7. 몇 가지 경고가 나타날 수 있지만 무시하십시오. 하단에는 로컬 및 공개 URL이 표시됩니다. 이제 로컬 URL 복사 copy the local URL 하여 웹브라우저에 붙여넣습니다. You may get a few warnings, but ignore them. At the bottom, you will get a local and public URL. Now, copy the local URL and paste it into the web browser. 8. 이것이 바로 ChatGPT API를 사용하여 나만의 AI 챗봇을 구축하는 방법입니다. ChatGPT 기반 AI 챗봇이 활성화되었습니다. 이제 원하는 질문을 하고 즉시 답변을 얻을 수 있습니다. ChatGPT 대안 외에도 공식 웹사이트 대신 나만의 챗봇을 사용할 수 있습니다. And that is how you build your own AI chatbot with the ChatGPT API. Your ChatGPT-powered AI chatbot is live. Now, you can ask any question you want and get answers in a jiffy. In addition to ChatGPT alternatives, you can use your own chatbot instead of the official website. 9. 공개 URL을 복사하여 친구나 가족과 공유할 수도 있습니다. 링크는 72시간 동안 유지되지만, 서버 인스턴스가 컴퓨터에서 실행되고 있으므로 컴퓨터를 계속 켜두어야 합니다. You can also copy the public URL and share it with your friends and family. The link will be live for 72 hours, but you also need to keep your computer turned on since the server instance is running on your computer. 10. 서버를 중지하려면 터미널로 이동하여 "Ctrl + C"를 누르세요. 작동하지 않으면 "Ctrl + C"를 다시 누르십시오. To stop the server, move to the Terminal and press “Ctrl + C“. If it does not work, press “Ctrl + C” again. 11. AI 챗봇 서버를 다시 시작 restart the AI chatbot 하려면 파일 경로를 다시 복사한 후 아래 명령을 다시 실행하면 됩니다(6단계와 유사). 로컬 URL은 동일하지만 공개 URL은 서버가 다시 시작될 때마다 변경됩니다. To restart the AI chatbot server, simply copy the path of the file again and run the below command again (similar to step #6). Keep in mind, the local URL will be the same, but the public URL will change after every server restart. python "C:UsersmearjDesktopapp.py" https://amzn.to/3Nps66m https://smartstore.naver.com/dopza/products/4569179898 Create Your Personalized ChatGPT API-Powered Chatbot 나만의 맞춤형 챗GPT API 기반 챗봇 만들기 "gpt-3.5-turbo" 모델의 가장 좋은 점은 AI에 역할을 할당할 수 있다는 것입니다. 재미있는 내용, 분노한 내용, 음식, 기술, 건강 분야의 전문가 등 원하는 대로 만들 수 있습니다. 코드를 조금만 변경하면 개인화됩니다. 예를 들어 저는 Food AI를 만들었고 그 방법은 다음과 같습니다. The best part about the “gpt-3.5-turbo” model is that you can assign a role to your AI. You can make it funny, angry, or a specialist in food, tech, health, or whatever you want. You just need to make one small change in the code and it will be personalized. For example – I have created a Food AI, and here’s how: 1. "app.py" 파일을 마우스 오른쪽 버튼으로 클릭하고 “Edit with Notepad++“을 선택합니다. Right-click on the “app.py” file and choose “Edit with Notepad++“. 2. 여기서는 이 특정코드만 변경 make changes to this particular code only합니다. 해당 역할을 맡으려면 AI에 정보를 제공하기만 하면 됩니다. 이제 "Ctrl + S"를 눌러 파일을 저장하세요. Here, make changes to this particular code only. Simply feed the information to the AI to assume that role. Now, save the file by pressing “Ctrl + S”. 3. 터미널을 열고 위와 비슷한 방식으로 “app.py” 파일을 실행합니다. 로컬 및 공개 URL을 받게 됩니다. 로컬 URL을 복사합니다. 서버가 이미 실행 중인 경우 "Ctrl + C"를 눌러 중지합니다. 그런 다음 서버를 다시 시작하십시오. "app.py" 파일을 변경할 때마다 서버를 다시 시작해야 합니다. Open Terminal and run the “app.py” file in a similar fashion as you did above. You will get a local and public URL. Copy the local URL. If a server is already running, press “Ctrl + C” to stop it. And then restart the server again. You will have to restart the server after every change you make to the “app.py” file. python "C:UsersmearjDesktopapp.py" 4. 웹브라우저에서 로컬 URL을 열면 음식 관련 질문에만 답변하는 맞춤형 AI 챗봇이 제공됩니다. 그게 모두 입니다. 모스 부호로 말하는 셰익스피어처럼 원하는 것은 무엇이든 대답하는 AI인 닥터 AI를 만들 수 있습니다. Open the local URL in the web browser and you will get a personalized AI chatbot that only answers food-related queries. That’s it. You can create a Doctor AI, an AI that replies like Shakespeare, which talks in morse code, anything you wish. Make Your Own AI Chatbot With ChatGPT 3.5 Model ChatGPT 3.5를 사용하여 나만의 AI 챗봇을 구축하는 방법은 다음과 같습니다. 또한, “gpt-3.5-turbo” 모델을 자신의 역할에 맞춰 개인화할 수 있습니다. AI의 가능성은 무한하며 원하는 것은 무엇이든 할 수 있습니다. 어쨌든 그것은 모두 우리에게서 나온 것입니다. Android 및 iOS에서 ChatGPT를 사용하는 방법을 알아보려면 링크된 기사를 참조하세요. ChatGPT로 할 수 있는 모든 멋진 작업에 대해 알아보려면 선별된 기사를 따르세요. 마지막으로 문제가 발생하면 아래 의견란에 알려주시기 바랍니다. 우리는 확실히 당신을 돕기 위해 노력할 것입니다. Windows, ChromeOS, Android, 보안 및 개인 정보 보호 문제에 열정적입니다. 일상적인 컴퓨팅 문제를 해결하려는 경향이 있습니다. 위에서 말한 대로 모든 것을 단계별로 실행했는데 이 오류가 발생했습니다. 도와주실 수 있나요? So this is how you can build your own AI chatbot with ChatGPT 3.5. In addition, you can personalize the “gpt-3.5-turbo” model with your own roles. The possibilities are endless with AI and you can do anything you want. Anyway, that is all from us. If you want to learn how to use ChatGPT on Android and iOS, head to our linked article. And to learn about all the cool things you can do with ChatGPT, go follow our curated article. Finally, if you are facing any issues, let us know in the comment section below. We will definitely try to help you out. Passionate about Windows, ChromeOS, Android, security and privacy issues. Have a penchant to solve everyday computing problems. I ran everything step by step as said above and I get this error. Could you help? C:Userskamil>python “C:UserskamilOneDriveDesktopapp.py” File “C:UserskamilOneDriveDesktopapp.py”, line 4 openai.api_key = api key SyntaxError: invalid imaginary literal Thank you. But what if I want to create a bit to run on my existing website? Hi I’m getting this error. How can I fix this? Traceback (most recent call last): File”C: UsersrussoDesktopChatbotapp•py”, line 2, in ‹module> import gradio as gr File “C: UsersrussoAppDataLocalProgramsPythonPython312|Libsite-packagesgradioinit_.py”, line 3, in import gradio._simple_templates File “C: Users russo AppDataLocalProgramsPython Python312Libsite-packagesgradiosimple_templatesinit py”, line 1, in ‹module> from . simpledropdown import SimpleDropdown File “C: Usersrusso AppDataLocalProgramsPythonPython312Libsite-packagesgradio_simple_templatessimpledropdown.py”, line 6, in from gradio. components. base import FormComponent File “C: UsersrussoAppDataLocalProgramsPythonPython312Libsite-packagesgradiocomponents_init•py”, line 1, in ‹module> from gradio. components.annotated_image import AnnotatedImage File “C: Users russoAppDataLocalPrograms PythonPython312Libsite-packagesgradiocomponents annotated_image. py”, line 12, in from gradio. components.base import Component File “C: UsersrussoAppDataLocalPrograms Python Python312|Libsite-packagesgradiocomponentsbase. py”, line 23, in from gradio. blocks import Block, BlockContext File “C: UsersrussoAppDataLocalProgramsPythonPython312Libsite-packagesgradioblocks.py”, line 27, in from gradio import ( File “C: UsersrussoAppDataLocalProgramsPythonPython312Libsite-packagesgradioanalytics.py”, line 10, in from distutils. version import StrictVersion ModuleNotFoundError: No module named distutils’ 제안해주세요, 감사합니다! 나도 같은 오류가 있습니다. 고치고 있나요? 이 오류를 수정하는 방법 모든 것이 잘 작동하고 챗봇 페이지가 열리지만 무언가를 입력하고 Enter 키를 누르면 오류 메시지가 표시됩니다. 이 문제에 직면한 다른 사람이 있나요? 이것은 굉장하고 실행이 간단합니다. 공유해 주셔서 감사합니다. ChatGPT를 사용하는 매우 간단하고 쉬운 방법입니다. 이 앱은 무료 요금제에서는 작동하지 않는다는 점을 명심하세요. 나는 다음과 같은 결론에 도달했습니다. 조정 끝점을 내가 원하는 대로 변경하려면 어떻게 해야 합니까? 제안된 절차에 따라 모든 작업을 수행했습니다. 그러나 다음과 같은 오류가 발생합니다. 도와주세요 Please suggest, thank you! i have same error. are you fix it ? how fix this error Everything is working well, the chatbot page opens, but when I type something and hit enter, it shows an error message. Anyone else facing this issue? This is awesome, Simple to run. Thanks for sharing. A very simple and easy way to try ChatGPT, just keep in mind that the APP will not work with the free plan. I came to the following conclusions. How can i Change the Moderation EndPoints to be what i want it to be I have done everything as per the procedure suggested. However, I get the following error. Can you please help C:Usersadmin>python “C:Usersapp.py” Traceback (most recent call last): File “C:Usersapp.py”, line 2, in import gradio as gr File “C:UsersadminAppDataLocalProgramsPythonPython311Libsite-packagesgradio__init__.py”, line 3, in import gradio.components as components File “C:UsersadminAppDataLocalProgramsPythonPython311Libsite-packagesgradiocomponents__init__.py”, line 1, in from gradio.components.annotated_image import AnnotatedImage File “C:UsersadminAppDataLocalProgramsPythonPython311Libsite-packagesgradiocomponentsannotated_image.py”, line 12, in from gradio import utils File “C:UsersadminAppDataLocalProgramsPythonPython311Libsite-packagesgradioutils.py”, line 37, in import matplotlib File “C:UsersadminAppDataLocalProgramsPythonPython311Libsite-packagesmatplotlib__init__.py”, line 242, in _check_versions() File “C:UsersadminAppDataLocalProgramsPythonPython311Libsite-packagesmatplotlib__init__.py”, line 236, in _check_versions module = importlib.import_module(modname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “C:UsersadminAppDataLocalProgramsPythonPython311Libimportlib__init__.py”, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “C:UsersadminAppDataLocalProgramsPythonPython311Libsite-packageskiwisolver__init__.py”, line 8, in from ._cext import ( ImportError: DLL load failed while importing _cext: The specified module could not be found. 여러분 모두 좋은 질문이 있습니다. GPT 채팅에 문의하면 대부분의 답변을 찾을 수 있습니다! 가장 정확하거나 정확한 답변을 드릴 수 있기 때문에 신형 4에 문의하겠습니다. 그것은 마치 마법과 같습니다! 그런데 코드는 Windows 11에서도 작동했습니다. 오류가 있는 모든 분들은 GPT에 복사하여 붙여넣기만 하면 오류가 수정됩니다. 이제 당신은 알고 있습니다. 물론이죠. 현존하는 답변 중 가장 쓸모없는 답변 그랬는데 방금 이겼어요! 축하해요! 안녕하세요, 작동합니다. 정말 감사합니다. VS 코드를 닫아도 작동하게 하려면 어떻게 해야 하나요? 정말 고마워요 정말 효과가 있어요… 핵심 개념을 이해할 만큼 지식이 부족합니다. 맹목적으로 따라가지만 라뉴아지에 대한 기본 지식은 있으므로 제 질문은… app.py 파일에 내 콘텐츠를 제공하고 그 후에 내 챗봇을 제공하는 것이 가능합니까? 내가 제공한 특정 콘텐츠에만 답변하세요. You all have great questions. Most of you can find your answers if you would just ask chat GPT! I would ask the new model 4 because it will give you the most accurate or correct answers. It is like magic! The code worked for me using Windows 11 too by the way. All of you with errors just copy and paste to GPT and it will correct your errors for you. Now you know. You are welcome. most useless reply in existence It was, but you just beat it! Congratulations! Hello, it works, thank you very much. How can I make it work even when I close VS code? thank you so much it really works … i don’t have enough knowledge to understand the core concept i just blindly follow you but have a basic knowledge about lagnuages so my question is …… is it possible that i provide my own content in the app.py file and after that my chatbot only answer to the specific content i provided if yes then how is it possible Here: https://beebom.com/how-train-ai-chatbot-custom-knowledge-base-chatgpt-api/ Here is a valid code acording to new libraries: import openai import gradio as gr import gradio.components as components openai.api_key = “your api key here” messages = [ {“role”: “system”, “content”: “You are a helpful and kind AI Assistant.”}, ] def chatbot(input): if input: messages.append({“role”: “user”, “content”: input}) chat = openai.ChatCompletion.create( model=”gpt-3.5-turbo”, messages=messages ) reply = chat.choices[0].message.content messages.append({“role”: “assistant”, “content”: reply}) return reply inputs = components.Textbox(lines=30, label=”Chat with AI”) outputs = components.Textbox(lines=30,label=”Reply”) iface = gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title=”Local ChatGPT <—", description="What you want to know?") iface.launch(server_name="192.168.0.11", server_port=7860) I get WInError 225, what should i do? I ran everything step by step as said above, it gave errors. Not one or two but many. The errors are something like this “Traceback (most recent call last): File “C:UserssahurAppDataLocalProgramsPythonPython311Libsite-packagestenacity__init__.py”, line 382, in __call__ result = fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File “C:UserssahurAppDataLocalProgramsPythonPython311Libsite-packagesgpt_indexembeddingsopenai.py”, line 147, in get_embeddings data = openai.Embedding.create(input=list_of_text, engine=engine).data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^”. 그리고 이것이 전부도 아닙니다. 실수가 없는지 확인하기 위해 모든 것을 제거하고 다시 설치했지만 같은 일이 계속해서 발생합니다. 이러한 오류를 해결하는 방법을 알려주세요! 경로를 변경하고 나중에 다시 시도하십시오. 이 기사를 제공해 주셔서 감사합니다. 우리 웹사이트에서 챗봇을 실행할 수도 있습니다. 웹 사이트, YouTube 채널 및 파일에 액세스하고 챗봇의 모든 내용을 파악하고 해당 챗봇에 질문할 수 있도록 도와주는 이미 시장에 나와 있는 도구와 유사한 thesamurai의 embedai와 같은 다른 옵션도 있습니다. Embedai는 주어진 정보에 따라 모든 질문에 답변할 것입니다. 안녕하세요. 저는 잘 작동하는 이 코드를 사용했습니다. 그러나 모델을 자체 훈련된 모델로 바꾸면 모델 ID가 존재하지 않는다는 오류가 발생합니다. 라인을 교체했어요 And this is not even all of it. I uninstalled and reinstalled everything just to make sure I made no mistakes, but the same thing happens again and again. Please tell me how to solve these errors! please change the path and try again later. Thanks for providing this article. we can also run a chatbot on our website. there are other options available like embedai by thesamurai -like tools that are already available in the market that help you can access your website, youtube channel, and file, notion all things in the chatbot, and ask questions to that chatbot. Embedai will answer all questions as per the given information. Hi i have used this code which works well, however replacing the Model with my own trained model it comes up with an error saying model id does not exist. I replaced the line Model=”gpt-3.5-turbo” With Model=”chatcmpl-load of number and letters” Add new comment Name Email ID |
반응형
댓글