Spaces:
Runtime error
Runtime error
frankaging
commited on
Commit
·
7849acf
1
Parent(s):
ef83e27
o1 impl
Browse files
app.py
CHANGED
|
@@ -104,13 +104,12 @@ def generate(
|
|
| 104 |
yield "[Truncated prior text]\n"
|
| 105 |
|
| 106 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
| 107 |
-
print(subspaces_list)
|
| 108 |
generate_kwargs = {
|
| 109 |
"base": {"input_ids": input_ids},
|
| 110 |
"unit_locations": None,
|
| 111 |
"max_new_tokens": max_new_tokens,
|
| 112 |
"intervene_on_prompt": True,
|
| 113 |
-
"subspaces": subspaces_list,
|
| 114 |
"streamer": streamer,
|
| 115 |
"do_sample": True
|
| 116 |
}
|
|
@@ -168,8 +167,6 @@ def update_dropdown_choices(search_text):
|
|
| 168 |
return gr.update(choices=filtered)
|
| 169 |
|
| 170 |
with gr.Blocks(css="style.css") as demo:
|
| 171 |
-
# A short title only
|
| 172 |
-
gr.Markdown("## Model Steering with ReFT-r1 (16K concepts)")
|
| 173 |
|
| 174 |
# Pre-populate with a random concept if available
|
| 175 |
default_subspaces = []
|
|
@@ -188,7 +185,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 188 |
with gr.Column(scale=7):
|
| 189 |
chat_interface = gr.ChatInterface(
|
| 190 |
fn=generate,
|
| 191 |
-
title="",
|
| 192 |
type="messages",
|
| 193 |
additional_inputs=[selected_subspaces],
|
| 194 |
)
|
|
|
|
| 104 |
yield "[Truncated prior text]\n"
|
| 105 |
|
| 106 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
|
|
|
| 107 |
generate_kwargs = {
|
| 108 |
"base": {"input_ids": input_ids},
|
| 109 |
"unit_locations": None,
|
| 110 |
"max_new_tokens": max_new_tokens,
|
| 111 |
"intervene_on_prompt": True,
|
| 112 |
+
"subspaces": [{"idx": subspaces_list["idx"], "mag": subspaces_list["internal_mag"]}],
|
| 113 |
"streamer": streamer,
|
| 114 |
"do_sample": True
|
| 115 |
}
|
|
|
|
| 167 |
return gr.update(choices=filtered)
|
| 168 |
|
| 169 |
with gr.Blocks(css="style.css") as demo:
|
|
|
|
|
|
|
| 170 |
|
| 171 |
# Pre-populate with a random concept if available
|
| 172 |
default_subspaces = []
|
|
|
|
| 185 |
with gr.Column(scale=7):
|
| 186 |
chat_interface = gr.ChatInterface(
|
| 187 |
fn=generate,
|
| 188 |
+
title="## LM Steering with ReFT-r1 (16K concepts)",
|
| 189 |
type="messages",
|
| 190 |
additional_inputs=[selected_subspaces],
|
| 191 |
)
|