Skip to content

Commit

Permalink
Omit progress event
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Jan 17, 2025
1 parent 280c3f6 commit 5082f29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/Composer/Progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const ProgressMessage: FC<ProgressMessageProps> = (props) => {
<Text>
{/* <Code>{info.name}</Code>から
<Code>{info.file}</Code>をダウンロード中 */}
ダウンロードを開始しました
ダウンロードしています
</Text>
</Box>
);
Expand All @@ -37,7 +37,7 @@ export const ProgressMessage: FC<ProgressMessageProps> = (props) => {
if (info.status === "progress") {
return (
<Box>
<Text>ダウンロード中</Text>
<Text>ダウンロードを進行しています</Text>
{/* <Text>
<Code>{info.name}</Code>から
<Code>{info.file}</Code>をダウンロード中
Expand Down
3 changes: 2 additions & 1 deletion src/components/Composer/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let instance;
async function getInstance(progressCallback) {
if (instance == null) {
instance = pipeline("text2text-generation", MODEL_NAME, {
revision: "b6cc98f634063743e4d911e21047b67b2c04fff7",
progress_callback: progressCallback,
});
}
Expand All @@ -18,7 +19,7 @@ async function getInstance(progressCallback) {

self.addEventListener("message", async (event) => {
const translator = await getInstance((x) => {
console.log(x);
if (x.status === "progress") return;
self.postMessage(x);
});

Expand Down

0 comments on commit 5082f29

Please sign in to comment.