Add Vicuna

This commit is contained in:
rlm
2023-05-05 19:58:05 -07:00
parent 8425f8a133
commit 2c0936ea91
4 changed files with 17 additions and 5 deletions
+10
View File
@@ -17,6 +17,9 @@ import pandas as pd
from typing import Dict, List
from json import JSONDecodeError
from langchain.llms import Anthropic
from langchain.llms import LlamaCpp
from langchain.callbacks.base import CallbackManager
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.chat_models import ChatAnthropic
from langchain.schema import BaseRetriever, Document
from langchain.chains.question_answering import load_qa_chain
@@ -103,6 +106,13 @@ def make_llm(model):
llm = Anthropic(temperature=0)
elif model == "Anthropic-100k":
llm = Anthropic(model="claude-v1-100k",temperature=0)
llm = ChatAnthropic(temperature=0)
elif model in ("vicuna-7b","vicuna-13b"):
callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])
if model == "vicuna-7b":
llm = LlamaCpp(model_path="/Users/31treehaus/Desktop/AI/llama.cpp/models/vicuna_7B/ggml-vicuna-7b-q4_0.bin", callback_manager=callback_manager, n_threads=16, n_ctx=10000, verbose=True, temperature=0)
else:
llm = LlamaCpp(model_path="/Users/31treehaus/Desktop/AI/llama.cpp/models/vicuna_13B/ggml-vicuna-13b-4bit.bin", callback_manager=callback_manager, n_threads=16, n_ctx=10000, verbose=True, temperature=0)
return llm
+2 -2
View File
@@ -8,7 +8,6 @@ tiktoken==0.3.1
faiss-cpu==1.7.3
huggingface-hub==0.12.0
anthropic==0.2.8
llama-cpp-python==0.1.32
pypdf==3.7.1
filetype==1.2.0
tokenizers==0.13.3
@@ -19,4 +18,5 @@ sse_starlette==1.3.3
gpt-index==0.5.16
faiss-cpu==1.7.3
python-dotenv==1.0.0
sentry_sdk==1.21.1
sentry_sdk==1.21.1
llama-cpp-python==0.1.43
+3 -3
View File
@@ -302,7 +302,7 @@ const Playground = ({ form }: { form: Form }) => {
title="Instructions"
style={alertStyle}
>
Upload a text file (up to 50 MB) and choose the parameters for your QA
Upload up to 10 text files (up to 50 MB each) and choose the parameters for your QA
chain. This evaluator will generate a test dataset of QA pairs and grade
the performance of the QA chain. You can experiment with different
parameters and evaluate the performance.
@@ -319,8 +319,8 @@ const Playground = ({ form }: { form: Form }) => {
setTestFilesDropzoneDisabled(false);
setFileUploadDisabled(true);
}}
maxFiles={1}
multiple={false}
maxFiles={10}
multiple={true}
maxSize={MAX_FILE_SIZE_MB * 1024 ** 2} // 50 MB
accept={[
MIME_TYPES.pdf,
+2
View File
@@ -98,6 +98,8 @@ const Sidebar = ({ form }: { form: Form }) => {
{ label: "GPT 3.5 Turbo", value: "gpt-3.5-turbo" },
{ label: "GPT 4", value: "gpt-4" },
{ label: "Anthropic", value: "anthropic" },
{ label: "Vicuna 7B", value: "vicuna-7b" },
{ label: "Vicuna 13B", value: "vicuna-13b" },
]}
/>
)}