Coder Social home page Coder Social logo

ai-starter-kit's Introduction

Warning

We are in the process of a major cleanup. Feel free to test as it is but expect changes/ post cleanup! <:

aistarterkit
Enabling teachers to experiment with LLM/ Generative AI

Key Features:

1 Text GenAI:

  • a) Chat Assistant (Visibility into backend)
  • b) Remarks Co-Pilot (Draft student remarks);
  • c) Semantic search on uploaded documents via LanceDB

2 Voice GenAI:

  • a) Oral coach (Personalized feedback based on audio input)
  • b) Transcription (Speech-to-text)

3 [WIP] Image GenAI

  • a) Create comic strips (Creating reasonably consistent images across panels for composition writing)
  • b) Historic stylistic art reimagination (Superimposing art styles/ palettes over uploaded images)

You can fork it at streamlit community cloud for immediate use. Please configure the env variables accordingly:

Important

The following env variables are required for setup. You can add this to the secrets.toml file in your streamlit deployment


openai_key = "YOUR_OPEN_API_KEY"
default_db = "chergpt.db"
default_temp = 0.0
default_frequency_penalty = 0.0
default_presence_penalty = 0.0
default_k_memory = 4
default_model = "gpt-4-1106-preview"
default_password = "default_password"
student_password = "studentp@sswrd"
teacher_password = "teacherp@sswrd"
super_admin_password = "pass1234"
super_admin = "super_admin"
default_title = "GenAI Workshop Framework V2"
sql_ext_path = "None"

*Note, While GPT-4 is the default model, you can also change models by modifying this setting:
default_model = gpt-3.5-turbo

Setting up local dev env

To run this locally, follow the steps below.

  1. Clone it to your local computer via Git. See here for a crash course to git.
  2. Create a virtual environment while in the project root directory. See here for how to create one.
  3. Prior to running locally, you will need to install required dependencies via this command pip install -r requirements.txt
    • If you encounter errors while installing the dependencies that is not related to 'conflicting dependencies', try pip install -r requirements.txt --default-timeout=100
    • Alternatively try again after some time.
  4. To run this locally, run streamlit run main.py

Questions? Ask them on WhatsApp | Discord

ai-starter-kit's People

Contributors

debbert avatar dependabot[bot] avatar ghostleek avatar jwsoh07 avatar twahidin avatar xuyangatwork avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

ai-starter-kit's Issues

fix: review and vet PR

Associated with #42

Teck Piaw and Kahhow: follow the following instructions to pull the specific branch that @twahidin created and test it locally. Any other bugs, please open as an issue in the issues tab here on github

Instructions:
Checkout via command line
If the conflicts on this branch are too complex to resolve in the web editor, you can check it out via command line to resolve the conflicts.

Step 1: Clone the repository or update your local repository with the latest changes (Skip because you already did this(?))
https://github.com/String-sg/chergpt-starter-kit.git

Step 2: Switch to the head branch of the pull request.
git pull origin main

Step 2.5: Run
git fetch
so that your local repository gets all the new info from Github. It just takes the information about new branches and no actual code. After that, the git checkout should work fine.

Step 3: Merge the base branch into the head branch.
git checkout basecodev2

Step 4: Fix the conflicts and commit the result.
git merge main

See Resolving a merge conflict using the command line for step-by-step instructions on resolving merge conflicts.

Step 5: Push the changes.
git push -u origin basecodev2

can administrator set the GPT model to use?

openai_key = "XXXXXXX_YOUR_API_KEY"
default_db = "chergpt.db"
default_temp = 0

default_model = "gpt-4"

default_model = "gpt-3.5"

can I use default_model = "gpt-3.5" instead?
didn't seems to work to 3.5 when i change the secrets on streamlit app- settings.
Screenshot 2023-09-22 at 8 07 12 AM

bug: deployment to streamlit

ERROR: Cannot install -r /mount/src/ai-starter-kit/requirements.txt (line 19) and urllib3==2.0.4 because these package versions have conflicting dependencies.

The conflict is caused by:

The user requested urllib3==2.0.4

botocore 1.33.11 depends on urllib3<1.27 and >=1.25.4; python_version < "3.10"

To fix this you could try to:

  1. loosen the range of package versions you've specified

  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

WARNING: You are using pip version 22.0.3; however, version 23.3.2 is available.

You should consider upgrading via the '/home/adminuser/venv/bin/python -m pip install --upgrade pip' command.

Checking if Streamlit is installed

Feat: User Management

Before: users are preseeded, hard cap of 5 teachers and 40 student accounts

Feature enhancement:

  • Enable admins to create additional teacher and student users
  • Enable teacher users to create additional student users

feat: add image gen and image processing

Feat: create classes

before:
code kinda exists for creating classes but most creation only done at the point of super admin creating orgs

after:
enable admins/ super users: to add classes

Bug: PandasAI not working

Discovered by @twahidin today:

  • History restored

(.venv) streamlit run main.py
Traceback (most recent call last):
File "/Users/joetay/Desktop/Starterkit/.venv/bin/streamlit", line 5, in
from streamlit.web.cli import main
File "/Users/joetay/Desktop/Starterkit/.venv/lib/python3.11/site-packages/streamlit/init.py", line 55, in
from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator
File "/Users/joetay/Desktop/Starterkit/.venv/lib/python3.11/site-packages/streamlit/delta_g
ImportError: cannot import name 'executor' from 'pandas.core._numba' (/Users/joetay/Desktop/Starterkit/.venv/lib/python3.11/site-packages/pandas/core/_numba/init.py)

feat: learning analytics

Currently, we have chatlogs already saved - need a way to create high-level learning analytics

User journey:

  • as a teacher, I should be able to see, e.g. top 5 bullet points of an interaction window
  • as a teacher, I should be able to filter by the interaction window (e.g. 1 week, 1 month), etc for these insights to be generated

UI: improve whitelabelling experience

Current: @twahidin manually toggles front end elements for COTF; "can do a test if user is school is something show a different logo and set a different API key"

Suggestion: deprioritize.

But if we really want, we can create themes to handle global styling instead of manually switching every time you switch between code bases

To investigate: error when adding/ creating vector store

image

TypeError: 'NoneType' object is not subscriptable
Traceback:
File "/Users/kahhowlee/code/chergpt-starter-kit/main.py", line 388, in main
create_vectorstore()
File "/Users/kahhowlee/code/chergpt-starter-kit/kb_module.py", line 366, in create_vectorstore
save_to_vectorstores(db, vs_name, subject, topic, st.session_state.user["username"], share_resource) # Passing the share_resource to the function
File "/Users/kahhowlee/code/chergpt-starter-kit/kb_module.py", line 283, in save_to_vectorstores
subject_id = cursor.fetchone()[0]

KeyError: None Traceback: File "/app/chergpt-starter-kit/main.py", line 356, in main bot_settings_interface( File "/app/chergpt-starter-kit/bot_settings.py", line 152, in bot_settings_interface selected_school_id = school_choices[selected_school_name]

it is just there, not really an error, see screenshot.

KeyError: None
Traceback:
File "/app/chergpt-starter-kit/main.py", line 356, in main
bot_settings_interface(
File "/app/chergpt-starter-kit/bot_settings.py", line 152, in bot_settings_interface
selected_school_id = school_choic
Screenshot 2023-10-18 at 9 14 28 AM
es[selected_school_name]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.