Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://github.com/AI-Maker-Space/Beyond-ChatGPT
Browse files
README.md
CHANGED
@@ -1,2 +1,66 @@
|
|
1 |
# Beyond-ChatGPT
|
2 |
Chainlit App using Python streaming for Level 0 MLOps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Beyond-ChatGPT
|
2 |
Chainlit App using Python streaming for Level 0 MLOps
|
3 |
+
|
4 |
+
LLM Application with Chainlit, Docker, and Huggingface Spaces
|
5 |
+
In this guide, we'll walk you through the steps to create a Language Learning Model (LLM) application using Chainlit, then containerize it using Docker, and finally deploy it on Huggingface Spaces.
|
6 |
+
|
7 |
+
Prerequisites
|
8 |
+
A GitHub account
|
9 |
+
Docker installed on your local machine
|
10 |
+
A Huggingface Spaces account
|
11 |
+
|
12 |
+
### Building our App
|
13 |
+
Clone this repo
|
14 |
+
|
15 |
+
Navigate inside this repo
|
16 |
+
|
17 |
+
### Install requirements using `pip install -r requirements.txt`?????????
|
18 |
+
|
19 |
+
Add your OpenAI Key to `.env` file and save the file.
|
20 |
+
|
21 |
+
Let's try deploying it locally. Make sure you're in the python environment where you installed Chainlit and OpenAI.
|
22 |
+
|
23 |
+
Run the app using Chainlit
|
24 |
+
|
25 |
+
```
|
26 |
+
chainlit run app.py -w
|
27 |
+
```
|
28 |
+
|
29 |
+
Great work! Let's see if we can interact with our chatbot.
|
30 |
+
|
31 |
+
It works! Let's ship it!
|
32 |
+
|
33 |
+
|
34 |
+
### Deploy to Huggingface Spaces
|
35 |
+
|
36 |
+
Login to Huggingface Spaces CLI
|
37 |
+
|
38 |
+
``` bash
|
39 |
+
huggingface-cli login
|
40 |
+
```
|
41 |
+
|
42 |
+
Follow the prompts to authenticate.
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
Push Docker Image to Huggingface Container Registry
|
47 |
+
|
48 |
+
```
|
49 |
+
docker tag llm-app:latest huggingface/your-username/llm-app:latest
|
50 |
+
docker push huggingface/your-username/llm-app:latest
|
51 |
+
```
|
52 |
+
|
53 |
+
Deploy to Huggingface Spaces
|
54 |
+
|
55 |
+
|
56 |
+
Deploying on Huggingface Spaces using a custom Docker image involves using their web interface. Go to Huggingface Spaces and create a new space, then set it up to use your Docker image from the Huggingface Container Registry.
|
57 |
+
|
58 |
+
Access the Application
|
59 |
+
|
60 |
+
Once deployed, access your app at:
|
61 |
+
|
62 |
+
ruby
|
63 |
+
Copy code
|
64 |
+
https://huggingface.co/spaces/your-username/llm-app
|
65 |
+
Conclusion
|
66 |
+
You've successfully created an LLM application with Chainlit, containerized it with Docker, and deployed it on Huggingface Spaces. Visit the link to interact with your deployed application.
|