Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,7 +51,7 @@ def format_docs(docs):
|
|
| 51 |
retriever = vectorstore.as_retriever(search_type="similarity_score_threshold", search_kwargs={"score_threshold": 0.3}, k=1)
|
| 52 |
|
| 53 |
prompt = hub.pull("rlm/rag-prompt")
|
| 54 |
-
llm = HuggingFaceEndpoint(repo_id="mistralai/Mistral-7B-Instruct-v0.3")
|
| 55 |
rag_chain = (
|
| 56 |
{"context": retriever | format_docs, "question": RunnablePassthrough()}
|
| 57 |
| prompt
|
|
@@ -144,7 +144,6 @@ async def echo(websocket):
|
|
| 144 |
while response.startswith("\n"):
|
| 145 |
response = response[1:]
|
| 146 |
await websocket.send(json.dumps({"response": response}))
|
| 147 |
-
print(rawresponse)
|
| 148 |
|
| 149 |
async def main():
|
| 150 |
async with serve(echo, "0.0.0.0", 7860):
|
|
|
|
| 51 |
retriever = vectorstore.as_retriever(search_type="similarity_score_threshold", search_kwargs={"score_threshold": 0.3}, k=1)
|
| 52 |
|
| 53 |
prompt = hub.pull("rlm/rag-prompt")
|
| 54 |
+
llm = HuggingFaceEndpoint(repo_id="mistralai/Mistral-7B-Instruct-v0.3", stop_sequences=["Human:"])
|
| 55 |
rag_chain = (
|
| 56 |
{"context": retriever | format_docs, "question": RunnablePassthrough()}
|
| 57 |
| prompt
|
|
|
|
| 144 |
while response.startswith("\n"):
|
| 145 |
response = response[1:]
|
| 146 |
await websocket.send(json.dumps({"response": response}))
|
|
|
|
| 147 |
|
| 148 |
async def main():
|
| 149 |
async with serve(echo, "0.0.0.0", 7860):
|