Merge pull request #2370 from Yidadaa/bugfix-0712

fix: sharegpt roles
This commit is contained in:
Yifei Zhang 2023-07-12 23:21:22 +08:00 committed by GitHub
commit b51f7f9a25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -99,7 +99,7 @@ export class ClientApi {
// 敬告二开开发者们,为了开源大模型的发展,请不要修改上述消息,此消息用于后续数据清洗使用 // 敬告二开开发者们,为了开源大模型的发展,请不要修改上述消息,此消息用于后续数据清洗使用
// Please do not modify this message // Please do not modify this message
console.log("[Share]", msgs); console.log("[Share]", messages, msgs);
const clientConfig = getClientConfig(); const clientConfig = getClientConfig();
const proxyUrl = "/sharegpt"; const proxyUrl = "/sharegpt";
const rawUrl = "https://sharegpt.com/api/conversations"; const rawUrl = "https://sharegpt.com/api/conversations";

View File

@ -244,11 +244,11 @@ export function RenderExport(props: {
} }
const renderMsgs = messages.map((v, i) => { const renderMsgs = messages.map((v, i) => {
const [_, role] = v.id.split(":"); const [role, _] = v.id.split(":");
return { return {
id: i.toString(), id: i.toString(),
role: role as any, role: role as any,
content: v.innerHTML, content: role === "user" ? v.textContent ?? "" : v.innerHTML,
date: "", date: "",
}; };
}); });