diff --git a/backend/requirements.txt b/backend/requirements.txt new file mode 100644 index 0000000..99837d8 --- /dev/null +++ b/backend/requirements.txt @@ -0,0 +1,103 @@ +accelerate==0.23.0 +aiohttp==3.8.6 +aiosignal==1.3.1 +annotated-types==0.6.0 +anyio==3.7.1 +async-timeout==4.0.3 +attrs==23.1.0 +auto-gptq==0.4.2+cu118 +autopep8==2.0.4 +bcrypt==4.0.1 +certifi==2023.7.22 +cffi==1.16.0 +charset-normalizer==3.3.0 +click==8.1.7 +coloredlogs==15.0.1 +coverage==7.3.2 +cryptography==41.0.5 +datasets==2.14.5 +dill==0.3.7 +exceptiongroup==1.1.3 +fastapi==0.103.2 +filelock==3.12.4 +frozenlist==1.4.0 +fsspec==2023.6.0 +gunicorn==21.2.0 +h11==0.14.0 +httpcore==1.0.1 +httptools==0.6.0 +httpx==0.25.1 +huggingface-hub==0.18.0 +humanfriendly==10.0 +idna==3.4 +iniconfig==2.0.0 +Jinja2==3.1.2 +MarkupSafe==2.1.3 +mpmath==1.3.0 +multidict==6.0.4 +multiprocess==0.70.15 +mysql-connector-python==8.2.0 +networkx==3.1 +numpy==1.24.4 +nvidia-cublas-cu12==12.1.3.1 +nvidia-cuda-cupti-cu12==12.1.105 +nvidia-cuda-nvrtc-cu12==12.1.105 +nvidia-cuda-runtime-cu12==12.1.105 +nvidia-cudnn-cu12==8.9.2.26 +nvidia-cufft-cu12==11.0.2.54 +nvidia-curand-cu12==10.3.2.106 +nvidia-cusolver-cu12==11.4.5.107 +nvidia-cusparse-cu12==12.1.0.106 +nvidia-nccl-cu12==2.18.1 +nvidia-nvjitlink-cu12==12.2.140 +nvidia-nvtx-cu12==12.1.105 +openai==0.28.1 +optimum==1.13.2 +packaging==23.2 +pandas==2.0.3 +passlib==1.7.4 +peft==0.5.0 +Pillow==10.1.0 +pluggy==1.3.0 +protobuf==4.21.12 +psutil==5.9.5 +pyarrow==13.0.0 +pycodestyle==2.11.1 +pycparser==2.21 +pydantic==2.4.2 +pydantic-core==2.10.1 +PyJWT==2.8.0 +pytest==7.4.2 +pytest-cov==4.1.0 +python-dateutil==2.8.2 +python-dotenv==1.0.0 +python-multipart==0.0.6 +pytz==2023.3.post1 +PyYAML==6.0.1 +regex==2023.10.3 +requests==2.31.0 +rouge==1.0.1 +safetensors==0.4.0 +sentencepiece==0.1.99 +six==1.16.0 +sniffio==1.3.0 +sse-starlette==1.6.5 +starlette==0.27.0 +sympy==1.12 +tenacity==8.2.3 +tiktoken==0.5.1 +tokenizers==0.14.1 +tomli==2.0.1 +torch==2.1.0 +tqdm==4.66.1 +transformers==4.34.0 +triton==2.1.0 +typing-extensions==4.8.0 +tzdata==2023.3 +urllib3==2.0.6 +uvicorn==0.23.2 +uvloop==0.17.0 +watchfiles==0.20.0 +websockets==11.0.3 +xxhash==3.4.1 +yarl==1.9.2 diff --git a/backend/tests/test_summary.py b/backend/tests/test_summary.py index dbfd640..5c582ce 100644 --- a/backend/tests/test_summary.py +++ b/backend/tests/test_summary.py @@ -6,7 +6,7 @@ reduce_multiple_summaries_to_one, reduce_summaries_list, generate_summary_tree, update_summary_path_url, get_number_of_inferences ) -from llama.custom_type import Summary +from llama.custom_type import Summary, ProxyAIBackend, GPT4Backend, GPT3Backend import random import string import tiktoken @@ -161,3 +161,10 @@ def test_get_number_of_inferences(): expected4 = 1 assert get_number_of_inferences(len(list4)) == expected4, "Failed on list smaller than split size" print("fourth case passed") + +def test_proxy_pattern(): + ai_backend = ProxyAIBackend(GPT4Backend()) + assert type(ai_backend.summary_generator) == GPT4Backend + ai_backend.summary_generator = GPT3Backend() + assert type(ai_backend.summary_generator) == GPT3Backend +