1
0
Fork 2

A small langchain demo project of a QA on movies

readme.md

A langchain movies demo in XetHub

We use langchain - index and openai to answer questions about Hollywood movies.

Requirements

pip install -r requirements.txt
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY

Usage

Train

# Retrain from scratch
python src/train.py

# Insert a file  
python src/put.py --branch=temp --hackx=10 tests/data/fresh_prince.txt data

# Remove a file
python src/delete.py --branch=temp data/fresh_prince.txt

Run the app

gradio app.py

Development story

Simply forked Yonatan's langchain_demo Xet repo from XetHub and then I wanted to build a similar app for movie trivia.

I grabbed a movies dataset from Kaggle and augmented using some Python code and IMDB, and then retrained the index and voila!

Just added a more representative image and the initial verison is done! Ask away!

Testing in the app:

Question: "Who played Neo in the 'The Matrix'?" Answer: "Keanu Reeves played Neo in The Matrix" Sources: "data/movies.csv"

Question: "Who voiced the voice of Nemo in 'Finding Nemo'"?

File List Total items: 12
Name Last Commit Size Last Modified
assets Added examples, app details, UI tweaks 9 months ago
data final dataset - 35K movies 1 year ago
gradio_cached_examples/16 Added examples, app details, UI tweaks 9 months ago
model Add the model 9 months ago
src Updated logging dir so capsule runs 9 months ago
tests attempting first model 1 year ago
.gitattributes
79 B
.gitignore move scripts to src 8.7 KiB 1 year ago
app.py Added examples, app details, UI tweaks 2.3 KiB 9 months ago
config.py fully working 300 B 1 year ago
readme.md Updated readme for movie demo 1.2 KiB 1 year ago
requirements.txt app working 1.7 KiB 1 year ago

About

A small langchain demo project of a QA on movies

Repository Size

Loading repo size...

Commits 80 commits

Collaborators

File Types