From 0191c30410e217f5a02fa7c3f58b60a1bceea98d Mon Sep 17 00:00:00 2001 From: Jay Baxter Date: Tue, 15 Aug 2023 19:53:24 -0700 Subject: [PATCH] Fix requirements.txt and add docs --- README.md | 19 ++++++++++++++++++- requirements.txt | 8 ++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1f172bf7..9ba0cb27 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,24 @@ The markdown files in this repo are the source of truth for the content in our d ### Community Notes open-source code -The algorithm that powers Community Notes can be found on the [sourcecode folder](https://github.com/twitter/communitynotes/tree/main/sourcecode), and instructions on how to use it can be found in the [Guide](https://twitter.github.io/communitynotes/note-ranking-code/). +The algorithm that powers Community Notes can be found in the [sourcecode folder](https://github.com/twitter/communitynotes/tree/main/sourcecode), and instructions on how to use it can be found in the [Guide](https://twitter.github.io/communitynotes/note-ranking-code/). + +While your normal Python install may "just work" if you're lucky, if you run into any issues and want to install the exact versions of Python packages that we've tested the code with, please create a new virtual environment and install the packages from requirements.txt: + +``` +$ python -m venv communitynotes_env +$ source communitynotes_env/bin/activate +$ pip install -r requirements.txt +``` + +Then after downloading the data files (see next section) into /sourcecode/, you will be able to run: + +``` +$ cd sourcecode +$ python main.py +``` + +Most versions of Python3 should work, but we have tested the code with Python 3.7.9. ### Community Notes data diff --git a/requirements.txt b/requirements.txt index 3a551e7f..20f1e93e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -numpy==1.21.6 -pandas==1.3.5 -matplotlib==3.5.2 +numpy==1.19.2 +pandas==1.1.5 tensorflow==2.5.0 - +torch==1.12.0 +matplotlib==3.5.2