From 51dfa48e2bde605de78f74da2e3c2f7896e5ee9c Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 29 Jun 2023 14:54:51 -0700 Subject: [PATCH] Have Khoj support Python 3.11 as Pytorch supports it now - Previously Khoj could only support Python upto 3.10 due to pytorch. But lots of folks had python 3.11 installed by default on their machines. This required installing python 3.10 and dealing with virtual envs. With Torch >= 2.0.1 now able to support python 3.11, at least one class of installation troubles for Khoj should drop. See https://github.com/pytorch/pytorch/issues/86566 for reference - Preliminary testing indicates using the new torch 2.x may reduce search time by 25% (from 80ms to 60ms on Mac M1) - Update Docs to not require mentioning python <=3.10 required - Update Github test workflow to run khoj tests with python 3.11 too --- .github/workflows/test.yml | 1 + README.md | 2 +- pyproject.toml | 5 +++-- src/interface/emacs/README.org | 2 +- src/interface/obsidian/README.md | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4554fcea..b54236f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,7 @@ jobs: - '3.8' - '3.9' - '3.10' + - '3.11' steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index 2d73084a..38cfb53a 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ https://user-images.githubusercontent.com/6413477/184735169-92c78bf1-d827-4663-9 ## Setup These are the general setup instructions for Khoj. -- Make sure [python](https://realpython.com/installing-python/) (version 3.10 or lower) and [pip](https://pip.pypa.io/en/stable/installation/) are installed on your machine +- Make sure [python](https://realpython.com/installing-python/) and [pip](https://pip.pypa.io/en/stable/installation/) are installed on your machine - Check the [Khoj.el Readme](https://github.com/khoj-ai/khoj/tree/master/src/interface/emacs#Setup) to setup Khoj with Emacs
Its simpler as it can skip the server *install*, *run* and *configure* step below. - Check the [Khoj Obsidian Readme](https://github.com/khoj-ai/khoj/tree/master/src/interface/obsidian#Setup) to setup Khoj with Obsidian
diff --git a/pyproject.toml b/pyproject.toml index bc5b04a2..c89f5575 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "khoj-assistant" description = "A natural language search engine for your personal notes, transactions and images" readme = "README.md" license = "GPL-3.0-or-later" -requires-python = ">=3.8, <3.11" +requires-python = ">=3.8" authors = [ { name = "Debanjum Singh Solanky, Saba Imran" }, ] @@ -31,6 +31,7 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Internet :: WWW/HTTP :: Indexing/Search", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Human Machine Interfaces", @@ -51,7 +52,7 @@ dependencies = [ "rich >= 13.3.1", "schedule == 1.1.0", "sentence-transformers == 2.2.2", - "torch == 1.13.1", + "torch >= 2.0.1", "uvicorn == 0.17.6", "aiohttp == 3.8.4", "langchain >= 0.0.187", diff --git a/src/interface/emacs/README.org b/src/interface/emacs/README.org index f38d694a..7dfb3050 100644 --- a/src/interface/emacs/README.org +++ b/src/interface/emacs/README.org @@ -41,7 +41,7 @@ [[/docs/khoj_chat_on_emacs_0.5.0.png]] ** Setup -- /Make sure [[https://realpython.com/installing-python/][python]] (version 3.10 or lower) and [[https://pip.pypa.io/en/stable/installation/][pip]] are installed on your machine/ +- /Make sure [[https://realpython.com/installing-python/][python]] and [[https://pip.pypa.io/en/stable/installation/][pip]] are installed on your machine/ - /khoj.el attempts to automatically install, start and configure the khoj server./ If this fails, follow [[https://github.com/khoj-ai/khoj/tree/master/#Setup][these instructions]] to manually setup the khoj server. diff --git a/src/interface/obsidian/README.md b/src/interface/obsidian/README.md index aac63a12..1cb72006 100644 --- a/src/interface/obsidian/README.md +++ b/src/interface/obsidian/README.md @@ -58,7 +58,7 @@ https://github.com/khoj-ai/khoj/assets/6413477/3e33d8ea-25bb-46c8-a3bf-c92f78d0f ![](https://github.com/khoj-ai/khoj/blob/master/src/interface/obsidian/docs/khoj_chat_on_obsidian_0.6.0.png?) ## Setup -- *Make sure [python](https://realpython.com/installing-python/) (version 3.10 or lower) and [pip](https://pip.pypa.io/en/stable/installation/) are installed on your machine* +- *Make sure [python](https://realpython.com/installing-python/) and [pip](https://pip.pypa.io/en/stable/installation/) are installed on your machine* - *Ensure you follow the ordering of the setup steps. Install the plugin after starting the khoj backend. This allows the plugin to configure the khoj backend* ### 1. Setup Backend