Spaces:
Build error
Build error
clementsan commited on
Commit ·
88fa380
1
Parent(s): 1e93bea
Add Mixtral-8x7B-Instruct-v0.1 model
Browse files19 unmodified lines2021222324251 unmodified line2728293031323328 unmodified lines6263646566676826 unmodified lines959697989910010119 unmodified lines# default_persist_directory = './chroma_HF/'llm_name1 = "mistralai/Mistral-7B-Instruct-v0.2"llm_name2 = "mistralai/Mistral-7B-Instruct-v0.1"llm_name3 = "meta-llama/Llama-2-7b-chat-hf"1 unmodified linellm_name5 = "mosaicml/mpt-7b-instruct"llm_name6 = "tiiuae/falcon-7b-instruct"llm_name7 = "google/flan-t5-xxl"list_llm = [llm_name1, llm_name2, llm_name3, llm_name4, llm_name5, llm_name6, llm_name7]list_llm_simple = [os.path.basename(llm) for llm in list_llm]# Load PDF document and create doc splits28 unmodified linesdef load_db():embedding = HuggingFaceEmbeddings()vectordb = Chroma(persist_directory=default_persist_directory,embedding_function=embedding)return vectordb26 unmodified lines# Use of trust_remote_code as model_kwargs# Warning: langchain issue# URL: https://github.com/langchain-ai/langchain/issues/6080if llm_model == "microsoft/phi-2":llm = HuggingFaceHub(repo_id=llm_model,model_kwargs={"temperature": temperature, "max_new_tokens": max_tokens, "top_k": top_k, "trust_remote_code": True, "torch_dtype": "auto"}19 unmodified lines202122232425261 unmodified line2829303132333428 unmodified lines6364656667686926 unmodified lines9697989910010110210310410510610719 unmodified lines# default_persist_directory = './chroma_HF/'llm_name0 = "mistralai/Mixtral-8x7B-Instruct-v0.1"llm_name1 = "mistralai/Mistral-7B-Instruct-v0.2"llm_name2 = "mistralai/Mistral-7B-Instruct-v0.1"llm_name3 = "meta-llama/Llama-2-7b-chat-hf"1 unmodified linellm_name5 = "mosaicml/mpt-7b-instruct"llm_name6 = "tiiuae/falcon-7b-instruct"llm_name7 = "google/flan-t5-xxl"list_llm = [llm_name0, llm_name1, llm_name2, llm_name3, llm_name4, llm_name5, llm_name6, llm_name7]list_llm_simple = [os.path.basename(llm) for llm in list_llm]# Load PDF document and create doc splits28 unmodified linesdef load_db():embedding = HuggingFaceEmbeddings()vectordb = Chroma(# persist_directory=default_persist_directory,embedding_function=embedding)return vectordb26 unmodified lines# Use of trust_remote_code as model_kwargs# Warning: langchain issue# URL: https://github.com/langchain-ai/langchain/issues/6080if llm_model == "mistralai/Mixtral-8x7B-Instruct-v0.1":llm = HuggingFaceHub(repo_id=llm_model,model_kwargs={"temperature": temperature, "max_new_tokens": max_tokens, "top_k": top_k, "load_in_8bit": True})elif llm_model == "microsoft/phi-2":llm = HuggingFaceHub(repo_id=llm_model,model_kwargs={"temperature": temperature, "max_new_tokens": max_tokens, "top_k": top_k, "trust_remote_code": True, "torch_dtype": "auto"}
app.py+9-3