Merge branch 'main' into custom-llm

This commit is contained in:
Alex committed 2023-02-15 14:42:57 +00:00
commit f9fe3f2f48
11 files changed
+219 -32

No files matched your search

+2
View File
@@ -5,6 +5,7 @@ import datetime
from flask import Flask, request, render_template
# os.environ["LANGCHAIN_HANDLER"] = "langchain"
import faiss
from langchain import FAISS
from langchain import OpenAI, VectorDBQA, HuggingFaceHub, Cohere
from langchain.chains.question_answering import load_qa_chain
@@ -77,6 +78,7 @@ def api_answer():
c_prompt = PromptTemplate(input_variables=["summaries", "question"], template=template)
# create a chain with the prompt template and the store
#llm = ManifestWrapper(client=manifest, llm_kwargs={"temperature": 0.001, "max_tokens": 2048})
llm = OpenAI(openai_api_key=api_key, temperature=0)
#llm = HuggingFaceHub(repo_id="bigscience/bloom", huggingfacehub_api_token=api_key)