-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from jasonacox/fastapi
Port Chatbot to FastAPI and Uvicorn ASGI
- Loading branch information
Showing
16 changed files
with
443 additions
and
357 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
# | ||
# Run the TinyLLM Chatbot using OpenAI GPT-3.5 | ||
# | ||
# Author: Jason A. Cox | ||
# 11 Feb 2024 | ||
# https://github.com/jasonacox/TinyLLM | ||
|
||
echo "Run TinyLLM Chatbot - OpenAI GPT-3.5" | ||
echo "------------------------------------" | ||
|
||
# Stop and remove the chatbot container | ||
echo "Removing old chatbot container..." | ||
docker stop chatbot | ||
docker rm chatbot | ||
|
||
# Start the chatbot container | ||
echo "Starting new chatbot container..." | ||
if [ ! -d "./.tinyllm" ]; then | ||
echo "Creating .tinyllm directory..." | ||
mkdir .tinyllm | ||
fi | ||
|
||
docker run \ | ||
-d \ | ||
-p 5000:5000 \ | ||
-e PORT=5000 \ | ||
-e OPENAI_API_KEY="YOUR_OPENAI_KEY" \ | ||
-e OPENAI_API_BASE="https://api.openai.com/v1" \ | ||
-e LLM_MODEL="gpt-3.5-turbo" \ | ||
-e USE_SYSTEM="false" \ | ||
-e MAXCLIENTS=1000 \ | ||
-e MAXTOKENS=4000 \ | ||
-e TEMPERATURE=0.0 \ | ||
-e QDRANT_HOST="localhost" \ | ||
-e SENTENCE_TRANSFORMERS_HOME=/app/.tinyllm \ | ||
-v $PWD/.tinyllm:/app/.tinyllm \ | ||
--name chatbot \ | ||
--restart unless-stopped \ | ||
jasonacox/chatbot | ||
echo "Chatbot container started." | ||
echo "" | ||
|
||
# Show the logs | ||
echo "Viewing chatbot container logs... ^C to exit" | ||
echo "" | ||
docker logs -f chatbot |
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
Oops, something went wrong.