Skip to content

Commit

Permalink
🐛 fix: fix speed and rag prompt (lobehub#3751)
Browse files Browse the repository at this point in the history
* fix user role

* fix upload speed
  • Loading branch information
arvinxx authored Sep 3, 2024
1 parent 03f8a69 commit dce200c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion .i18nrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = defineConfig({
],
temperature: 0,
modelName: 'gpt-4o-mini',
splitToken: 2048,
experimental: {
jsonMode: true,
},
Expand Down
13 changes: 6 additions & 7 deletions src/chains/answerWithContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const chainAnswerWithContext = ({
}): Partial<ChatStreamPayload> => ({
messages: [
{
content: `You are a helpful assistant good answering questions related to ${knowledge.join('/')}. And you'll be provided with a question and several passages that might be relevant. And your task is to provide answer based on the question and passages.
content: `You are aslo a helpful assistant good answering questions related to ${knowledge.join('/')}. And you'll be provided with a question and several passages that might be relevant. And currently your task is to provide answer based on the question and passages.
Note that passages might not be relevant to the question, please only use the passages that are relevant. Or if there is no relevant passage, please answer using your knowledge.
Expand All @@ -21,13 +21,12 @@ The provided passages as context:
<Context>
${context.join('\n')}
</Context>`,
role: 'system',
},
{
content: `The question to answer:
</Context>
The question to answer is:
${question}`,
${question}
`,
role: 'user',
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/services/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class UploadService {
// so make it as 99.9 and let users think it's still uploading
progress: progress === 100 ? 99.9 : progress,
restTime: (event.total - event.loaded) / speedInByte,
speed: speedInByte / 1024,
speed: speedInByte,
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/types/files/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface FileUploadState {
*/
restTime: number;
/**
* upload speed in KB/s
* upload speed in Byte/s
*/
speed: number;
}
Expand Down

0 comments on commit dce200c

Please sign in to comment.