-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from JadenFiotto-Kaufman/dev
Dev
- Loading branch information
Showing
16 changed files
with
255 additions
and
99 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* .status-container { | ||
background-color: '#F84F31'; | ||
} */ | ||
|
||
.status-body { | ||
color: "white"; | ||
} | ||
|
||
.accordion-header { | ||
margin: 0 !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,149 @@ | ||
:html_theme.sidebar_secondary.remove: | ||
:sd_hide_title: | ||
|
||
status | ||
.. raw:: html | ||
|
||
<link rel="stylesheet" href="../_static/css/status.css"> | ||
<script> | ||
function autoFormatJsonString(jsonString) { | ||
// Parse the JSON string into an object | ||
let jsonObject = JSON.parse(jsonString); | ||
// Convert the object back into a string with indentation | ||
let prettyPrintedJson = JSON.stringify(jsonObject, null, 2); | ||
// Replace keys in the JSON string with styled spans | ||
prettyPrintedJson = prettyPrintedJson.replace(/"([^"]+)":/g, '<span style="background-color: lightgrey;">"$1":</span>'); | ||
// Set the formatted JSON string as the innerHTML of the element | ||
document.getElementById('jsonContainer').innerHTML = `<pre>${prettyPrintedJson}</pre>`; | ||
} | ||
fetch("https://ndif.dev/ping") | ||
.then((response) => { | ||
if (response.status == 200) { | ||
Array.from(document.getElementsByClassName("status-container")).forEach((elm) => { | ||
elm.style.backgroundColor = "#23C552"; | ||
Array.from(elm.getElementsByClassName('sd-card-text')).forEach((text) => { | ||
text.textContent = "All Systems Are Operational"; | ||
text.style.color = "#FFFFFF"; | ||
}); | ||
}); | ||
console.log('Ping success'); | ||
// Nested fetch to ndif.dev/stats | ||
fetch("https://ndif.dev/stats") | ||
.then((statsResponse) => { | ||
if (statsResponse.status == 200) { | ||
statsResponse.json().then((parsed) => { | ||
// Initialize an empty string to accumulate information | ||
let infoString = ''; | ||
let index = 0; | ||
let modelSummary = {}; | ||
Object.values(parsed).forEach((value) => { | ||
// Create a unique key for each model-config combination | ||
let modelConfigKey = `${value.repo_id}`; | ||
// Check if this model-config combination already exists in the summary | ||
if (modelSummary[modelConfigKey]) { | ||
// Increment the count if it does | ||
modelSummary[modelConfigKey].number_of_copies += 1; | ||
} else { | ||
// Otherwise, add a new entry | ||
modelSummary[modelConfigKey] = { | ||
number_of_copies: 1, | ||
config_string: value.config_json_string | ||
}; | ||
} | ||
}); | ||
// Now modelSummary contains the consolidated information | ||
console.log(modelSummary); | ||
// Iterate through the JSON dictionary and append information | ||
// Iterate through the modelSummary dictionary and append information | ||
Object.keys(modelSummary).forEach((key) => { | ||
var headingId = 'heading' + (index + 1); | ||
var collapseId = 'collapse' + (index + 1); | ||
const summaryItem = modelSummary[key]; | ||
const configJsonString = summaryItem.config_string; | ||
let jsonObject = JSON.parse(configJsonString); | ||
// Convert the object back into a string with indentation | ||
let prettyPrintedJson = JSON.stringify(jsonObject, null, 4); | ||
prettyPrintedJson = prettyPrintedJson.replace(/"([^"]+)":/g, '"<b>$1</b>":'); | ||
let huggingFaceLink = `<a href="http://huggingface.co/${key}" target="_blank">HuggingFace Model Repository ↗</a>`; | ||
infoString += `<div class="accordion-item"> <h2 class="accordion-header" id="${headingId}"> <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#${collapseId}" aria-expanded="false" aria-controls="${collapseId}"> (${summaryItem.number_of_copies}x) ${key} </button> </h2> <div id="${collapseId}" class="accordion-collapse collapse" aria-labelledby="${headingId}" data-bs-parent="#accordionExample"> <div class="accordion-body">${huggingFaceLink}</i> <pre>${prettyPrintedJson}</pre></div> </div> </div>`; | ||
index++; | ||
}); | ||
var elm = document.getElementById("accordionHook"); | ||
elm.innerHTML = infoString; | ||
console.log('Stats success'); | ||
}).catch((jsonError) => { | ||
console.log('JSON parsing error:', jsonError); | ||
}); | ||
} else { | ||
console.log('Stats error'); | ||
} | ||
}) | ||
.catch((statsError) => { | ||
console.log('Stats error'); | ||
}); | ||
} else { | ||
Array.from(document.getElementsByClassName("status-container")).forEach((elm) => { | ||
elm.style.backgroundColor = "#F84F31"; | ||
Array.from(elm.getElementsByClassName('sd-card-text')).forEach((text) => { | ||
text.textContent = "NDIF Is Unavailable"; | ||
text.style.color = "#FFFFFF"; | ||
}); | ||
}); | ||
console.log('Ping error'); | ||
} | ||
}) | ||
.catch((pingError) => { | ||
Array.from(document.getElementsByClassName("status-container")).forEach((elm) => { | ||
elm.style.backgroundColor = "#F84F31"; | ||
Array.from(elm.getElementsByClassName('sd-card-text')).forEach((text) => { | ||
text.textContent = "NDIF Is Unavailable"; | ||
text.style.color = "#FFFFFF"; | ||
}); | ||
}); | ||
console.error('Ping fetch failed:', pingError); | ||
}); | ||
</script> | ||
|
||
|
||
Status | ||
====== | ||
|
||
|
||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:hidden: | ||
|
||
|
||
|
||
.. card:: | ||
|
||
All Systems Are Operational | ||
|
||
|
||
|
||
.. div:: sd-fs-1 sd-font-weight-bold sd-text-center sd-text-primary sd-mb-5 | ||
|
||
Key Features | ||
|
||
.. grid:: 1 1 2 2 | ||
:class-container: features | ||
|
||
.. grid-item:: | ||
|
||
.. div:: features-container | ||
|
||
.. image:: _static/images/one.png | ||
:width: 250 | ||
|
||
.. div:: | ||
|
||
**Integration** | ||
|
||
Pass in a ID from any HuggingFace Transformer repo and access its weights with nnsight. | ||
|
||
.. grid-item:: | ||
|
||
.. div:: features-container | ||
|
||
.. image:: _static/images/two.png | ||
:width: 250 | ||
|
||
.. div:: | ||
|
||
**Interpretability** | ||
|
||
Access the internal gradients and activations at any point or module in a model. | ||
:class-card: status-container | ||
|
||
.. grid-item:: | ||
|
||
.. div:: features-container | ||
|
||
.. image:: _static/images/two.png | ||
:width: 250 | ||
|
||
.. div:: | ||
|
||
**Intuitive** | ||
|
||
Set up a context block and manipulate model internals with only a couple lines of code. | ||
|
||
.. grid-item:: | ||
|
||
.. div:: features-container | ||
|
||
.. image:: _static/images/one.png | ||
:width: 250 | ||
|
||
.. div:: | ||
|
||
**Interoperable** | ||
All Systems Are Operational | ||
|
||
Enable grad and train interventions like LORA or probes on any point in a model. | ||
.. raw:: html | ||
|
||
<div class="accordion accordion-flush" id="accordionHook"> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.