This is a lightweight python project to demonistrate how-to
- Create and manage GPT-4 assistants and threads.
- Create Phi-3-mini chat.
- Use Azure Translator to complement the model translation capabilities to improve the low resource languages translation quality.
- Use fast python async calls with Quart and Uvicorn.
- You created AIServices resource/project (https://ai.azure.com) and deployed GPT-4 and Phi-3-mini models. You will need this information to modify ".env_template."
- [optional] Install VS code
- Install node.js and npm using https://nodejs.org/dist/v22.1.0/node-v22.1.0-x64.msi
- Clone this repo
- Launch VS code
- Select the project folder
- Start VS code terminal and run the following install commands:
- npm install
- npm install @mui/material @emotion/react @chatscope/chat-ui-kit-react
- npm install react-select
- python -m pip install -r requirements.txt
- modify ".env_template" and rename to ".env"
- Start VS code and open the app folder from "File" tab
- Create 2 terminals
- In terminal 1 run: python -m uvicorn app:app --port 5000 --reload
- Wait for Application startup complete.
- In terminal 2 run: npm start
- Type query in Ask anything.
- Use slider switch for Azure AI Translator.
- Select deployment model (phi-3-mini-4k-instruct as an example for chat and GPT-4 for assistants).
- Change query paramters as needed.
- Clear chat to remove session chat history.
- When Azure Traslator is enabled, this repo supports translation from source language to French, German, Chinese, Spanish and English.
- You can add more target lanaguages by modifying get_target_language() found in backend/gpt_2_assistant.py and backend/phi_3_assistant.py