Browse Source

fix: sharegpt roles

Yidadaa 1 year ago
parent
commit
d275e32e70
2 changed files with 3 additions and 3 deletions
  1. 1 1
      app/client/api.ts
  2. 2 2
      app/components/exporter.tsx

+ 1 - 1
app/client/api.ts

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

+ 2 - 2
app/components/exporter.tsx

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