Skip to content

Commit

Permalink
Added choice of model to allow continue use of GPT 3.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
emeryberger committed Jul 28, 2023
1 parent b8706d7 commit 70c274b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions scalene/scalene-gui/index.html.template
Original file line number Diff line number Diff line change
Expand Up @@ -2611,6 +2611,13 @@ Prism.languages.py = Prism.languages.python;
<input type="text" style="font-size: 0.8rem" size="22" placeholder="(OpenAI API key)" id="api-key" oninput="checkApiKey(event.target.value)"></input>
<span id='valid-api-key'></span>
<br />
<label style="font-size: 0.8rem" for="language-model">
Language model:
</label>
<select style="font-size: 0.8rem" id="language-model" name="language-model-label">
<option style="font-size: 0.8rem" value="gpt-3.5-turbo">GPT 3.5</option>
<option style="font-size: 0.8rem" value="gpt-4" selected>GPT 4.0</option>
</select>
<div>
<input type="radio" name="optimize-radio" id="optimize-performance" value="performance" checked>
<label style="font-size: 0.8rem" for="optimize-performance">
Expand Down
5 changes: 3 additions & 2 deletions scalene/scalene-gui/scalene-gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ function extractCode(text) {

async function sendPromptToOpenAI(prompt, len, apiKey) {
const endpoint = "https://api.openai.com/v1/chat/completions";
const model = document.getElementById('language-model').value;

const body = JSON.stringify({
// model: 'gpt-3.5-turbo',
model: 'gpt-4',
model: model,
messages: [
{
role: 'system',
Expand Down

0 comments on commit 70c274b

Please sign in to comment.