-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67bc0df
commit d40a83a
Showing
4 changed files
with
224 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,185 @@ | ||
--- | ||
title: GPT4.5TurboApp | ||
title: GPT4TurboApp | ||
emoji: π | ||
colorFrom: blue | ||
colorTo: purple | ||
sdk: docker | ||
pinned: false | ||
--- | ||
|
||
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | ||
<p align = "center" draggable=βfalseβ ><img src="https://github.com/AI-Maker-Space/LLM-Dev-101/assets/37101144/d1343317-fa2f-41e1-8af1-1dbb18399719" | ||
width="200px" | ||
height="auto"/> | ||
</p> | ||
|
||
|
||
## <h1 align="center" id="heading">:wave: Welcome to Beyond ChatGPT!!</h1> | ||
|
||
## π€ GPT-4 Turbo Application with DALL-E 3 Image Generation | ||
|
||
> If you need an introduction to `git`, or information on how to set up API keys for the tools we'll be using in this repository - check out our [Interactive Dev Environment for LLM Development](https://github.com/AI-Maker-Space/Interactive-Dev-Environment-for-LLM-Development/tree/main) which has everything you'd need to get started in this repository! | ||
In this repository, we'll walk you through the steps to create a Large Language Model (LLM) application using Chainlit, then containerize it using Docker, and finally deploy it on Huggingface Spaces. | ||
|
||
Are you ready? Let's get started! | ||
|
||
<details> | ||
<summary>π₯οΈ Accessing "gpt-3.5-turbo" (ChatGPT) like a developer</summary> | ||
|
||
1. Head to [this notebook](https://colab.research.google.com/drive/1mOzbgf4a2SP5qQj33ZxTz2a01-5eXqk2?usp=sharing) and follow along with the instructions! | ||
|
||
2. Complete the notebook and try out your own system/assistant messages! | ||
|
||
That's it! Head to the next step and start building your application! | ||
|
||
</details> | ||
|
||
|
||
<details> | ||
<summary>ποΈ Building Your GPT-4 Turbo Application with DALL-E 3 Image Generation</summary> | ||
|
||
1. Clone [this](https://github.com/AI-Maker-Space/Beyond-ChatGPT/tree/main) repo. | ||
|
||
``` bash | ||
git clone https://github.com/AI-Maker-Space/Beyond-ChatGPT.git | ||
``` | ||
|
||
2. Navigate inside this repo | ||
``` bash | ||
cd Beyond-ChatGPT | ||
``` | ||
|
||
3. Install the packages required for this python envirnoment in `requirements.txt`. | ||
``` bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
4. Open your `.env` file. Replace the `###` in your `.env` file with your OpenAI Key and save the file. | ||
``` bash | ||
OPENAI_API_KEY=sk-### | ||
``` | ||
|
||
5. Let's try deploying it locally. Make sure you're in the python environment where you installed Chainlit and OpenAI. Run the app using Chainlit. This may take a minute to run. | ||
``` bash | ||
chainlit run app.py -w | ||
``` | ||
|
||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/54bcccf9-12e2-4cef-ab53-585c1e2b0fb5"> | ||
</p> | ||
|
||
Great work! Let's see if we can interact with our chatbot. | ||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/854e4435-1dee-438a-9146-7174b39f7c61"> | ||
</p> | ||
Awesome! Time to throw it into a docker container and prepare it for shipping! | ||
</details> | ||
<details> | ||
<summary>π³ Containerizing our App</summary> | ||
1. Let's build the Docker image. We'll tag our image as `llm-app` using the `-t` parameter. The `.` at the end means we want all of the files in our current directory to be added to our image. | ||
``` bash | ||
docker build -t llm-app . | ||
``` | ||
2. Run and test the Docker image locally using the `run` command. The `-p`parameter connects our **host port #** to the left of the `:` to our **container port #** on the right. | ||
``` bash | ||
docker run -p 7860:7860 llm-app | ||
``` | ||
3. Visit http://localhost:7860 in your browser to see if the app runs correctly. | ||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/2c764f25-09a0-431b-8d28-32246e0ca1b7"> | ||
</p> | ||
Great! Time to ship! | ||
</details> | ||
<details> | ||
<summary>π Deploying Your First LLM App</summary> | ||
1. Let's create a new Huggingface Space. Navigate to [Huggingface](https://huggingface.co) and click on your profile picture on the top right. Then click on `New Space`. | ||
|
||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/f0656408-28b8-4876-9887-8f0c4b882bae"> | ||
</p> | ||
|
||
2. Setup your space as shown below: | ||
|
||
- Owner: Your username | ||
- Space Name: `llm-app` | ||
- License: `Openrail` | ||
- Select the Space SDK: `Docker` | ||
- Docker Template: `Blank` | ||
- Space Hardware: `CPU basic - 2 vCPU - 16 GB - Free` | ||
- Repo type: `Public` | ||
|
||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/8f16afd1-6b46-4d9f-b642-8fefe355c5c9"> | ||
</p> | ||
|
||
3. You should see something like this. We're now ready to send our files to our Huggingface Space. After cloning, move your files to this repo and push it along with your docker file. You DO NOT need to create a Dockerfile. Make sure NOT TO push your `.env` file. This should automatically be ignored. | ||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/cbf366e2-7613-4223-932a-72c67a73f9c6"> | ||
</p> | ||
4. After pushing all files, navigate to the settings in the top right to add your OpenAI API key. | ||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/a1123a6f-abdd-4f76-bea4-39acf9928762"> | ||
</p> | ||
5. Scroll down to `Variables and secrets` and click on `New secret` on the top right. | ||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/a8a4a25d-752b-4036-b572-93381370c2db"> | ||
</p> | ||
6. Set the name to `OPENAI_API_KEY` and add your OpenAI key under `Value`. Click save. | ||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/0a897538-1779-48ff-bcb4-486af30f7a14"> | ||
</p> | ||
7. To ensure your key is being used, we recommend you `Restart this Space`. | ||
<p align = "center" draggable=βfalseβ> | ||
<img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/fb1d83af-6ebe-4676-8bf5-b6d88f07c583"> | ||
</p> | ||
8. Congratulations! You just deployed your first LLM! πππ Get on linkedin and post your results and experience! Make sure to tag us at #AIMakerspace ! | ||
Here's a template to get your post started! | ||
|
||
``` | ||
ππ Exciting News! ππ | ||
ποΈΒ Today, I'm thrilled to announce that I've successfully built and shipped my first-ever LLM using the powerful combination of Chainlit, Docker, and the OpenAI API! π₯οΈ | ||
Check it out π | ||
[LINK TO APP] | ||
A big shoutout to the @**AI Makerspace** for all making this possible. Couldn't have done it without the incredible community there. π€π | ||
Looking forward to building with the community! πβ¨Β Here's to many more creations ahead! π₯π | ||
Who else is diving into the world of AI? Let's connect! ππ‘ | ||
#FirstLLM #Chainlit #Docker #OpenAI #AIMakerspace | ||
``` | ||
</details> | ||
<p></p> | ||
### That's it for now! And so it begins.... :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
# Welcome to Chainlit! ππ€ | ||
# Welcome to a GPT-4 Turbo application with DALL-E 3 Image Generation capabilities! | ||
|
||
Hi there, Developer! π We're excited to have you on board. Chainlit is a powerful tool designed to help you prototype, debug and share applications built on top of LLMs. | ||
|
||
## Useful Links π | ||
|
||
- **Documentation:** Get started with our comprehensive [Chainlit Documentation](https://docs.chainlit.io) π | ||
- **Discord Community:** Join our friendly [Chainlit Discord](https://discord.gg/ZThrUxbAYw) to ask questions, share your projects, and connect with other developers! π¬ | ||
|
||
We can't wait to see what you create with Chainlit! Happy coding! π»π | ||
|
||
## Welcome screen | ||
|
||
To modify the welcome screen, edit the `chainlit.md` file at the root of your project. If you do not want a welcome screen, just leave this file empty. | ||
Hey! We're excited to provide you with a GPT-4 Turbo-powered application complete with Image Generation! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters