Spaces:
Running
Running
Update index.html
Browse files- index.html +12 -38
index.html
CHANGED
@@ -120,44 +120,18 @@
|
|
120 |
const addTabBtn = document.getElementById('add-tab-btn');
|
121 |
|
122 |
// --- Example Code ---
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
`;
|
136 |
-
|
137 |
-
const exampleCodeDeps = `
|
138 |
-
# This class is an external dependency, not defined here
|
139 |
-
# from modeling_outputs import BaseModelOutputWithPast
|
140 |
-
|
141 |
-
# A common mixin for attention mechanisms
|
142 |
-
class AttentionMixin:
|
143 |
-
def _init_attention(self, config):
|
144 |
-
self.num_heads = config.num_heads
|
145 |
-
self.head_dim = config.hidden_size // config.num_heads
|
146 |
-
|
147 |
-
def _split_heads(self, tensor):
|
148 |
-
# Logic to split tensor for multi-head attention
|
149 |
-
return tensor
|
150 |
-
|
151 |
-
# A base class for all models, similar to PreTrainedModel
|
152 |
-
class BaseModel:
|
153 |
-
def __init__(self, config):
|
154 |
-
self.config = config
|
155 |
-
|
156 |
-
def from_pretrained(cls, model_name):
|
157 |
-
# Load weights
|
158 |
-
pass
|
159 |
-
`;
|
160 |
-
|
161 |
// --- Tab Management ---
|
162 |
let tabCounter = 0;
|
163 |
|
|
|
120 |
const addTabBtn = document.getElementById('add-tab-btn');
|
121 |
|
122 |
// --- Example Code ---
|
123 |
+
fetch("main_code.py")
|
124 |
+
.then(res => res.text())
|
125 |
+
.then(code => {
|
126 |
+
const exampleCodeMain = code;
|
127 |
+
// do something with it
|
128 |
+
});
|
129 |
+
fetch("dependencies.py")
|
130 |
+
.then(res_deps => res_deps.text())
|
131 |
+
.then(code_deps => {
|
132 |
+
const exampleCodeDeps = code_deps;
|
133 |
+
// do something with it
|
134 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
// --- Tab Management ---
|
136 |
let tabCounter = 0;
|
137 |
|