mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 20:35:00 +00:00
renamed hf-embed -> help
This commit is contained in:
parent
bd8143a880
commit
b18dbf4772
8 changed files with 23 additions and 22 deletions
|
@ -15,14 +15,14 @@ warnings.simplefilter("ignore", category=FutureWarning)
|
||||||
|
|
||||||
def install_help_extra(io):
|
def install_help_extra(io):
|
||||||
pip_install_cmd = [
|
pip_install_cmd = [
|
||||||
"aider-chat[hf-embed]",
|
"aider-chat[help]",
|
||||||
"--extra-index-url",
|
"--extra-index-url",
|
||||||
"https://download.pytorch.org/whl/cpu",
|
"https://download.pytorch.org/whl/cpu",
|
||||||
]
|
]
|
||||||
res = utils.check_pip_install_extra(
|
res = utils.check_pip_install_extra(
|
||||||
io,
|
io,
|
||||||
"llama_index.embeddings.huggingface",
|
"llama_index.embeddings.huggingface",
|
||||||
"To use interactive /help you need to install HuggingFace embeddings",
|
"To use interactive /help you need to install the help extras",
|
||||||
pip_install_cmd,
|
pip_install_cmd,
|
||||||
)
|
)
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -9,7 +9,7 @@ COPY . /aider
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install --no-install-recommends -y build-essential git libportaudio2 && \
|
apt-get install --no-install-recommends -y build-essential git libportaudio2 && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
pip install --no-cache-dir /aider[hf-embed] --extra-index-url https://download.pytorch.org/whl/cpu && \
|
pip install --no-cache-dir /aider --extra-index-url https://download.pytorch.org/whl/cpu && \
|
||||||
rm -rf /aider
|
rm -rf /aider
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
|
@ -4,5 +4,6 @@ addopts = -p no:warnings
|
||||||
testpaths =
|
testpaths =
|
||||||
tests/basic
|
tests/basic
|
||||||
tests/help
|
tests/help
|
||||||
|
tests/browser
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# This file is autogenerated by pip-compile with Python 3.12
|
# This file is autogenerated by pip-compile with Python 3.12
|
||||||
# by the following command:
|
# by the following command:
|
||||||
#
|
#
|
||||||
# pip-compile --output-file=requirements/requirements-hf-embed.txt requirements/requirements-hf-embed.in
|
# pip-compile --output-file=requirements/requirements-help.txt requirements/requirements-help.in
|
||||||
#
|
#
|
||||||
aiohttp==3.9.5
|
aiohttp==3.9.5
|
||||||
# via
|
# via
|
||||||
|
@ -109,10 +109,10 @@ llama-cloud==0.0.6
|
||||||
# via llama-index-core
|
# via llama-index-core
|
||||||
llama-index-core==0.10.52.post2
|
llama-index-core==0.10.52.post2
|
||||||
# via
|
# via
|
||||||
# -r requirements/requirements-hf-embed.in
|
# -r requirements/requirements-help.in
|
||||||
# llama-index-embeddings-huggingface
|
# llama-index-embeddings-huggingface
|
||||||
llama-index-embeddings-huggingface==0.2.2
|
llama-index-embeddings-huggingface==0.2.2
|
||||||
# via -r requirements/requirements-hf-embed.in
|
# via -r requirements/requirements-help.in
|
||||||
markupsafe==2.1.5
|
markupsafe==2.1.5
|
||||||
# via
|
# via
|
||||||
# -c requirements/../requirements.txt
|
# -c requirements/../requirements.txt
|
|
@ -8,7 +8,7 @@ pip-compile \
|
||||||
--output-file=requirements.txt \
|
--output-file=requirements.txt \
|
||||||
$1
|
$1
|
||||||
|
|
||||||
for SUFFIX in dev hf-embed browser playwright; do
|
for SUFFIX in dev help browser playwright; do
|
||||||
|
|
||||||
pip-compile \
|
pip-compile \
|
||||||
requirements/requirements-${SUFFIX}.in \
|
requirements/requirements-${SUFFIX}.in \
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -33,7 +33,7 @@ packages += ["aider.website"]
|
||||||
|
|
||||||
print("Packages:", packages)
|
print("Packages:", packages)
|
||||||
|
|
||||||
extras = "dev hf-embed browser playwright".split()
|
extras = "dev help browser playwright".split()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="aider-chat",
|
name="aider-chat",
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
# Add the parent directory to the Python path
|
|
||||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
|
|
||||||
|
|
||||||
from aider.main import main
|
from aider.main import main
|
||||||
|
|
||||||
|
|
||||||
class TestBrowser(unittest.TestCase):
|
class TestBrowser(unittest.TestCase):
|
||||||
@patch('aider.main.launch_gui')
|
@patch("aider.main.launch_gui")
|
||||||
def test_browser_flag_imports_streamlit(self, mock_launch_gui):
|
def test_browser_flag_imports_streamlit(self, mock_launch_gui):
|
||||||
# Run main with --browser and --yes flags
|
# Run main with --browser and --yes flags
|
||||||
main(['--browser', '--yes'])
|
main(["--browser", "--yes"])
|
||||||
|
|
||||||
# Check that launch_gui was called
|
# Check that launch_gui was called
|
||||||
mock_launch_gui.assert_called_once()
|
mock_launch_gui.assert_called_once()
|
||||||
|
|
||||||
# Try to import streamlit
|
# Try to import streamlit
|
||||||
try:
|
try:
|
||||||
import streamlit
|
import streamlit # noqa: F401
|
||||||
|
|
||||||
streamlit_imported = True
|
streamlit_imported = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
streamlit_imported = False
|
streamlit_imported = False
|
||||||
|
|
||||||
# Assert that streamlit was successfully imported
|
# Assert that streamlit was successfully imported
|
||||||
self.assertTrue(streamlit_imported, "Streamlit should be importable after running with --browser flag")
|
self.assertTrue(
|
||||||
|
streamlit_imported, "Streamlit should be importable after running with --browser flag"
|
||||||
|
)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue