Spaces:
Running on Zero
Show the submitted temperature in the Studio prompt inspector
The Prompt inspector reads the current Sampling Temperature slider after a prediction, so it can show a temperature the request never used.
I replayed seven responses generated at temperature 0.0 (greedy) with the released bfloat16 weights on Apple MPS through the Studio UI in Chrome, once for each of its two request paths (direct NDJSON and the Gradio parent bridge), for 14 prediction replays. Each request had temperature 0.0. Moving the slider to 0.9 during the pending result showed Temp 0.9 in all 14 inspectors after completion, and moving it again to 0.3 after completion showed Temp 0.3 in all 14.
This small patch captures the submitted payload temperature and uses it in the Prompt inspector. With the patch, all 28 checks displayed Temp 0.0 (Greedy), and both captured text fields matched the recorded response before and after. An independently written Node regression tests the reverse direction by submitting 0.6 and moving the slider to 0.0 before completion. It exits 1 on upstream and 0 with the patch. Run the following Node regression from the Studio checkout.
const assert = require('node:assert/strict');
const fs = require('node:fs');
const vm = require('node:vm');
const elements = new Map();
const document = {
readyState: 'loading', addEventListener() {},
getElementById(id) {
if (!elements.has(id)) elements.set(id, { classList: { add() {}, remove() {} } });
return elements.get(id);
},
};
const parent = {
__triggerCellGemmaZeroGPU(body) {
assert.equal(JSON.parse(body).temperature, 0.6);
return true;
},
};
const source = fs.readFileSync(process.argv[2] || 'static/app.js', 'utf8');
const regression = source.replace(/\}\)\(\);\s*$/, `
syncUI = () => {};
appState.temperature = 0.6;
startLiveRun();
appState.temperature = 0;
window.__onZeroGpuStream(JSON.stringify({ type: 'complete', state: {
cell_line: 'A549', cell_idx: 0,
} }));
openPromptModal();
})();`);
vm.runInNewContext(regression, { window: { parent }, document, performance });
assert.match(elements.get('prompt-modal-meta').textContent, /Temp 0\.6/);
🤖 Generated with Claude Code