Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -44,12 +44,12 @@ def add_text(history, text):
|
|
44 |
def generate_response(history, query):
|
45 |
global COUNT, N, chat_history, chain, k
|
46 |
db=database()
|
47 |
-
llm=HuggingFaceHub(repo_id="
|
48 |
chain = load_qa_chain(llm, chain_type="stuff")
|
49 |
doc = (db.similarity_search_with_score(query))
|
50 |
score=doc[0][-1]
|
51 |
doc = doc[0][:-1]
|
52 |
-
threshold = 0.
|
53 |
|
54 |
|
55 |
if score > threshold:
|
|
|
44 |
def generate_response(history, query):
|
45 |
global COUNT, N, chat_history, chain, k
|
46 |
db=database()
|
47 |
+
llm=HuggingFaceHub(repo_id="stabilityai/stable-code-3b", model_kwargs={"temperature":1, "max_length":500},huggingfacehub_api_token=apii)
|
48 |
chain = load_qa_chain(llm, chain_type="stuff")
|
49 |
doc = (db.similarity_search_with_score(query))
|
50 |
score=doc[0][-1]
|
51 |
doc = doc[0][:-1]
|
52 |
+
threshold = 0.7
|
53 |
|
54 |
|
55 |
if score > threshold:
|