1
0
Fork 0

A small langchain demo project of a QA on movies

Assaf Vayner
58903fc71c 11 months ago 81 commits

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: 11
Name Last Commit Size Last Modified
data Minor fixes 1 year ago
docs/images fully working 1 year ago
model Add the model 11 months ago
src merging 11 months ago
tests attempting first model 1 year ago
.gitattributes Initial commit 79 B 1 year ago
.gitignore gitignore 8.7 KiB 1 year ago
app.py Add the model 2.7 KiB 11 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 81 commits

File Types