u/brOSKI is a chat bot that attempts to help Berkeley students with everything Cal while trained to sound like the average r/berkeley enjoyer. We accomplish with a dual pronged approach. In order to get the "sound" of a funny berkeley student, I trained LLaMA 2 13b on the r/berkeley subreddit using the together.ai API, and in order to get the knowledge and accuracy of a Cal advisor, LeonShams ustilized prompt engineering and LLama 2 13b to currate our data based on class information, teacher biographies and enrollment information. This way our model could give helpful information to the user. pranavdo implemented the front end, which displays a user interface that interacts with the backend to call LLama 2 12b.
u/brOSKI is finetuned with the help of together.ai, which offers a very easy to use API to train and deploy the model. Unfortunately, the API does not yet support your finetuned models to be used with your local code. So unless you are signed into my account, you cannot YET talk to the finetunened u/brOSKI. Nonetheless, there will be some pictures provided below of some of the funny answers u/brOSKI gave after chating with it for about 10 minutes.
This program was built during CalHacks 2023 so it has only been in development for about 48 hours (as of 10/29/2023). Considering the extremely short time frame, we are extremely happy with the results of our model. All of the code that we used during those 48 hours are provided here in this github. Stay tuned, because we have future visions of expanding the model even more!
Finetuned chat bot, the "brO" side of u/brOSKI
![im a person](https://private-user-images.githubusercontent.com/83364878/278910605-cdcdf748-7517-4181-88c4-651cba1fac68.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1OTkxNzgsIm5iZiI6MTcyNDU5ODg3OCwicGF0aCI6Ii84MzM2NDg3OC8yNzg5MTA2MDUtY2RjZGY3NDgtNzUxNy00MTgxLTg4YzQtNjUxY2JhMWZhYzY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI1VDE1MTQzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkzNGMzN2RiM2EyOGQ4MmIyZjM3NTczMWVjYmU0ZmM4MjZjOTU2MGY2MDY2NWFlN2JlMDY0MmVjYjQxZDcyZWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.giVkg6zSaDIEmbFMtlDM3T4LNS3NyLfBl-VEzztSX-s)
![are you a berkeley student](https://private-user-images.githubusercontent.com/83364878/278910581-f7aa96f2-e459-4b09-9d21-566bc57a7689.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1OTkxNzgsIm5iZiI6MTcyNDU5ODg3OCwicGF0aCI6Ii84MzM2NDg3OC8yNzg5MTA1ODEtZjdhYTk2ZjItZTQ1OS00YjA5LTlkMjEtNTY2YmM1N2E3Njg5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI1VDE1MTQzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBmZTExZmU0NTkzOGQ0MTdmMWQ1OTEwN2M1MWNlODQ3Yzk2NDM4OWY5NjQ1NjU3ZDFjODQ0MzY5MTY1YzdmNjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3sONRNQ3yovOvQWtDnxG03ywse0d5r6QZupb7htPt9U)
![paulin](https://private-user-images.githubusercontent.com/83364878/278910623-a8af1df9-3c25-48f3-9cf9-9d33b89d80b1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1OTkxNzgsIm5iZiI6MTcyNDU5ODg3OCwicGF0aCI6Ii84MzM2NDg3OC8yNzg5MTA2MjMtYThhZjFkZjktM2MyNS00OGYzLTljZjktOWQzM2I4OWQ4MGIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI1VDE1MTQzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY2MDkxNmRlNzE1NmZmZTViNjJjMmNkYWYzYWZlZDRjNjgzMWViYTViMzg3NDQ0NTYwOTVkMmJkMWIwOTIyYTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.QMOhCPU4hEhR4h3Ds5DHon_23wUjMT1BcJrNd6Ghjk8)
![whats the meaning of life](https://private-user-images.githubusercontent.com/83364878/278910652-d2564557-7e91-401a-966b-d13705ca0646.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1OTkxNzgsIm5iZiI6MTcyNDU5ODg3OCwicGF0aCI6Ii84MzM2NDg3OC8yNzg5MTA2NTItZDI1NjQ1NTctN2U5MS00MDFhLTk2NmItZDEzNzA1Y2EwNjQ2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI1VDE1MTQzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ4MDY5ZWY5N2NmYTE5NzJhOGQ4YmE5MjQ2NWE1MjY2YjY2ZDA4MzhlMmI1NGU2OTVmZGVlNTVkMjg2YmYxMWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5S7803bDxmJa7L7XZnYsfMIfay4N1yc6bTATLdTgV0g)
The data we used for this model was about 3500 lines of r/berkeley posts from 2023 formated in Q&A style. Where the title and body are the "question" and the most upvoted comment is the "answer". The model is trained for 6 epochs. There is MUCH MUCH room for improvement here considering our biggest limiting factor was finding and downloading data within the CalHacks time frame. -Note: The data that we curated removes personal user information.
Context analysis chat bot, the "u/OSKI" side of u/brOSKI
You need to use your own together.ai API Key to run this program.
Requirements:
pip install together
pip install flask
pip install flask_cors
Step 1> while inside ./CalCompanion run
python api.py
Step 2> open up the index.html fine
Step 3> Chat away!