Skip to content

Commit

Permalink
clean up some code
Browse files Browse the repository at this point in the history
  • Loading branch information
aviaryan committed Aug 8, 2024
1 parent 4a7d7f2 commit 56a2b15
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 94 deletions.
2 changes: 1 addition & 1 deletion src/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; media-src 'self' blob:;">
<title>Transcribe App</title>
<title>Voice Writing</title>
</head>
<body>
<!-- You can also require other files to run in this process -->
Expand Down
1 change: 0 additions & 1 deletion src/main/ipc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { ipcMain } = require("electron");
const { spawn } = require("child_process");
const Groq = require("groq-sdk");
// thanks to https://stackoverflow.com/a/48270043/2295672 for terminal
const Terminal = require("terminal.js");

const groq = new Groq({
Expand Down
4 changes: 0 additions & 4 deletions src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ const createWindow = () => {
preload: path.join(__dirname, "preload.js"),
},
});

// and load the index.html of the app.
mainWindow.loadFile(path.join(__dirname, "index.html"));

// Open the DevTools.
// mainWindow.webContents.openDevTools()
};

// This method will be called when Electron has finished
Expand Down
6 changes: 1 addition & 5 deletions src/renderer/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
</script>

<main>
<h1>Voice Input App</h1>
<!-- <button on:click={() => (count += 1)}>
Counter: {count}
</button>
<button on:click={transcribe}> Transcribe </button> -->
<h1>Voice Writing</h1>
<Streamer />
</main>

Expand Down
82 changes: 0 additions & 82 deletions src/renderer/Recorder.svelte

This file was deleted.

2 changes: 1 addition & 1 deletion src/renderer/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function postProcessTranscription(text) {
text = text.replace("[Start speaking]", ""); // don't need it now, earlier it served as a prompt
const prompt = promptRoot + "\n\n" + text;
const chatCompletion = await window.api.callGroqApi(prompt);
console.log(chatCompletion);
// console.log(chatCompletion);
let fixed = chatCompletion.choices[0]?.message?.content || "";
// clean up stuff
fixed = fixed.replace(/^Here is the [^:]*text.*:/i, "");
Expand Down

0 comments on commit 56a2b15

Please sign in to comment.