Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaki-1052 committed Jul 28, 2024
1 parent 2561bd3 commit 5f1d936
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 1 addition & 6 deletions public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,8 @@ let currentModelID;
async function fetchDefaultModel() {
try {
const response = await fetch('/model');

const data = await response.json();
if (data) {
currentModelID = data.model;
} else {
currentModelID = 'gpt-4o';
}
currentModelID = data.model;
} catch (error) {
console.error('Error fetching default model:', error);
}
Expand Down
2 changes: 2 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2383,6 +2383,8 @@ app.get('/model', (req, res) => {

if (defaultModel) {
res.json({ model: defaultModel });
} else {
res.json({ model: 'gpt-4o' });
}
});

Expand Down

0 comments on commit 5f1d936

Please sign in to comment.