Skip to content

Commit

Permalink
Feat/0.2.2 (#259)
Browse files Browse the repository at this point in the history
报告生成,map-rerank,
  • Loading branch information
yaojin3616 committed Jan 12, 2024
2 parents 31e26cb + f467499 commit 7ff131f
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 6 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/backend/bisheng/api/v1/qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ def get_original_file(*, message_id: int, keys: str, session: Session = Depends(
chunk_res['source_url'] = minio_client.get_share_link(str(chunk.file_id))
chunk_res['original_url'] = minio_client.get_share_link(
file.object_name if file.object_name else str(file.id))
chunk_res['source'] = file.file_name
else:
chunk_res['source_url'] = ''
chunk_res['original_url'] = ''
chunk_res['source'] = ''

chunk_res['score'] = round(match_score(chunk.chunk, keywords),
2) if len(keywords) > 0 else 0
chunk_res['file_id'] = chunk.file_id
chunk_res['source'] = file.file_name

result.append(chunk_res)

Expand Down
2 changes: 1 addition & 1 deletion src/backend/bisheng/graph/vertex/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ async def _build_dict_of_nodes_and_update_params(self, key, dicts, user_id=None)
else:
self.params[key][k] = (k1, v1)
elif self._is_node(v[1]):
result = v[1].get_result(user_id)
result = await v[1].get_result(user_id)
self.params[key][k] = (v[0], result)
else:
self.params[key][k] = (v[0], v[1])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def add_extra_fields(self) -> None:
show=True,
name='request_timeout',
advanced=True,
value=10))
value=600))
self.template.add_field(self.file_path_templates[self.template.type_name])
elif self.template.type_name in self.file_path_templates:
self.template.add_field(self.file_path_templates[self.template.type_name])
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/pages/ChatAppPage/components/FileView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { FixedSizeList as List, areEqual } from 'react-window';

const SASS_HOST = 'https://bisheng.dataelem.com'
export const checkSassUrl = (url: string) => {
return url
return url.replace(/https?:\/\/[^\/]+/, '')
// location.origin === SASS_HOST ? url.replace(/https?:\/\/[^\/]+/, '') : url;
}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export function classNames(...classes: Array<string>): string {
}

export function downloadFile(url, label) {
axios.get(url, { responseType: "blob" }).then(response => {
const blob = new Blob([response.data]);
axios.get(url, { responseType: "blob" }).then((res: any) => {
const blob = new Blob([res]);
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = label;
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
secure: false,
ws: true,
};
proxyObj['/bisheng'] = {
target: "http://110.16.193.170:50061",
changeOrigin: true,
withCredentials: true,
secure: false
}
return proxyObj;
}, {});

Expand Down

0 comments on commit 7ff131f

Please sign in to comment.