Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def run_query(query, chat_history, k, temperature,openai_api_key):
|
|
| 14 |
db = Chroma(persist_directory=persist_directory, embedding_function=OpenAIEmbeddings()) # access db
|
| 15 |
retriever = db.as_retriever(search_kwargs={"k": k}) # kwargs determines how many docs it uses
|
| 16 |
|
| 17 |
-
llm = OpenAI(
|
| 18 |
# we get from the llm (do note the llm has a cap of 4097.) and temperature provides a scale form 0.0 to 1.0 of how much freedom
|
| 19 |
# the llm should take in its response (how closely it should adhere to docs vs how freely)
|
| 20 |
|
|
|
|
| 14 |
db = Chroma(persist_directory=persist_directory, embedding_function=OpenAIEmbeddings()) # access db
|
| 15 |
retriever = db.as_retriever(search_kwargs={"k": k}) # kwargs determines how many docs it uses
|
| 16 |
|
| 17 |
+
llm = OpenAI(openai_api_key, max_tokens=1500, temperature=temperature) # api key self explanatory. max_tokens provides how long of a response
|
| 18 |
# we get from the llm (do note the llm has a cap of 4097.) and temperature provides a scale form 0.0 to 1.0 of how much freedom
|
| 19 |
# the llm should take in its response (how closely it should adhere to docs vs how freely)
|
| 20 |
|