Skip to content

Commit 8fa11bd

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f8eaee4 commit 8fa11bd

40 files changed

+546
-423
lines changed

EdgeCraftRAG/docker_compose/intel/gpu/arc/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ For more advanced env variables and configurations, please refer to [Prepare env
9595

9696
### 5. Deploy the Service on Intel GPU Using Docker Compose
9797

98-
set Milvus DB and chat history round for inference:
98+
set Milvus DB and chat history round for inference:
99+
99100
```bash
100101
# EC-RAG support Milvus as persistent database, by default milvus is disabled, you can choose to set MILVUS_ENABLED=1 to enable it
101102
export MILVUS_ENABLED=0
@@ -123,7 +124,7 @@ docker compose -f docker_compose/intel/gpu/arc/compose_vllm.yaml up -d
123124
#### option b. Deploy the Service on Arc B60 Using Docker Compose
124125

125126
```bash
126-
# Besides MILVUS_ENABLED and CHAT_HISTORY_ROUND, below enviroments are exposed for vLLM config, you can change them to your preference:
127+
# Besides MILVUS_ENABLED and CHAT_HISTORY_ROUND, below environments are exposed for vLLM config, you can change them to your preference:
127128
# export VLLM_SERVICE_PORT_B60=8086
128129
# export DTYPE=float16
129130
# export TP=1 # for multi GPU, you can change TP value

EdgeCraftRAG/docker_compose/intel/gpu/arc/compose_vllm_b60.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,4 @@ services:
183183
-dp=$${DP}"
184184
networks:
185185
default:
186-
driver: bridge
186+
driver: bridge

EdgeCraftRAG/docs/API_Guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,4 @@ curl -X POST http://${HOST_IP}:16010/v1/retrieval -H "Content-Type: application/
219219

220220
```bash
221221
curl -X POST http://${HOST_IP}:16011/v1/chatqna -H "Content-Type: application/json" -d '{"messages":"#REPLACE WITH YOUR QUESTION HERE#", "top_n":5, "max_tokens":512}' | jq '.'
222-
```
222+
```

EdgeCraftRAG/docs/Advanced_Setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,6 @@ Model preparation is the same as vLLM inference section, please refer to [Prepar
208208

209209
This section is the same as default vLLM inference section, please refer to [Prepare env variables and configurations](../docker_compose/intel/gpu/arc/README.md#prepare-env-variables-and-configurations) and [Start Edge Craft RAG Services with Docker Compose](../docker_compose/intel/gpu/arc/README.md#deploy-the-service-on-arc-a770-using-docker-compose)
210210

211-
### 2. Access Kbadmin UI
211+
### 2. Access Kbadmin UI
212212

213213
please refer to [ChatQnA with Kbadmin in UI](./Explore_Edge_Craft_RAG.md#chatqna-with-kbadmin-in-ui)

EdgeCraftRAG/docs/Explore_Edge_Craft_RAG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ After knowledge base creation, you can upload the documents for retrieval.
3434
Then, you can submit messages in the chat box in `Chat` page.
3535
![chat_with_rag](../assets/img/chatqna.png)
3636

37-
## ChatQnA with Kbadmin in UI
37+
## ChatQnA with Kbadmin in UI
3838

3939
### Kbadmin Pipeline
4040

@@ -52,4 +52,4 @@ Please select 'kbadmin' in `Type`and select kb name from the kbs you created in
5252
![upload_data](../assets/img/kbadmin_kb.png)
5353

5454
Then, you can submit messages in the chat box in `Chat` page.
55-
![chat_with_rag](../assets/img/chatqna.png)
55+
![chat_with_rag](../assets/img/chatqna.png)

EdgeCraftRAG/edgecraftrag/api/v1/chatqna.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def chatqna(request: ChatCompletionRequest):
3838
active_kb = ctx.knowledgemgr.get_active_knowledge_base()
3939
request.user = active_kb if active_kb else None
4040
if experience_kb:
41-
request.tool_choice = 'auto' if experience_kb.experience_active else 'none'
41+
request.tool_choice = "auto" if experience_kb.experience_active else "none"
4242
generator = ctx.get_pipeline_mgr().get_active_pipeline().generator
4343
if generator:
4444
request.model = generator.model_id
@@ -62,7 +62,7 @@ async def ragqna(request: ChatCompletionRequest):
6262
active_kb = ctx.knowledgemgr.get_active_knowledge_base()
6363
request.user = active_kb if active_kb else None
6464
if experience_kb:
65-
request.tool_choice = 'auto' if experience_kb.experience_active else 'none'
65+
request.tool_choice = "auto" if experience_kb.experience_active else "none"
6666
generator = ctx.get_pipeline_mgr().get_active_pipeline().generator
6767
if generator:
6868
request.model = generator.model_id

EdgeCraftRAG/edgecraftrag/api/v1/data.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def redindex_data():
3535
pl = ctx.get_pipeline_mgr().get_active_pipeline()
3636
kb = ctx.get_knowledge_mgr().get_active_knowledge_base()
3737
if kb:
38-
kb_name = kb.name
38+
kb_name = kb.name
3939
docs_name = kb_name + pl.name + str(pl.indexer.d)
4040
else:
4141
kb_name = None
@@ -45,7 +45,7 @@ async def redindex_data():
4545
pl.update_indexer_to_retriever()
4646

4747
all_docs = []
48-
docs_list =ctx.get_file_mgr().get_kb_files_by_name(docs_name)
48+
docs_list = ctx.get_file_mgr().get_kb_files_by_name(docs_name)
4949
for docs_file in docs_list:
5050
all_docs.extend(docs_file.documents)
5151
nodelist = ctx.get_pipeline_mgr().run_data_prepare(docs=all_docs)
@@ -99,9 +99,10 @@ async def delete_file(kb_name, file_path):
9999
if nodelist is not None and len(nodelist) > 0:
100100
ctx.get_node_mgr().add_nodes(pl.node_parser.idx, nodelist)
101101

102-
return f"File is deleted"
102+
return "File is deleted"
103103
else:
104-
return f"File not found"
104+
return "File not found"
105+
105106

106107
# DELETE a file
107108
@data_app.delete(path="/v1/data/all_files/{name}")
@@ -118,6 +119,7 @@ async def delete_all_file(name):
118119
else:
119120
return f"File {name} not found"
120121

122+
121123
# Upload & save a file from UI
122124
@data_app.post(path="/v1/data/file/{file_name}")
123125
async def upload_file(file_name: str, file: UploadFile = File(...)):
@@ -145,4 +147,4 @@ async def upload_file(file_name: str, file: UploadFile = File(...)):
145147
except Exception as e:
146148
raise HTTPException(
147149
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"Failed to upload file: {str(e)}"
148-
)
150+
)

0 commit comments

Comments
 (0)