mirror of
https://github.com/elder-plinius/OBLITERATUS.git
synced 2026-08-17 16:37:30 +02:00
ci: add reproducible supply-chain gates
This commit is contained in:
@@ -892,7 +892,7 @@ def _get_vram_html() -> str:
|
||||
reserved_html = (
|
||||
f'<span style="color:#4a5568;">reserved: {mem.reserved_gb:.1f} GB</span>'
|
||||
if mem.reserved_gb > 0
|
||||
else f'<span style="color:#4a5568;">unified memory</span>'
|
||||
else '<span style="color:#4a5568;">unified memory</span>'
|
||||
)
|
||||
return (
|
||||
f'<div style="margin:6px auto 0;max-width:480px;">'
|
||||
@@ -1020,7 +1020,7 @@ def _generate_analysis_figs(pipeline, model_label: str = "") -> list:
|
||||
plot_cross_layer_heatmap,
|
||||
plot_angular_drift,
|
||||
)
|
||||
import tempfile, os
|
||||
import tempfile
|
||||
|
||||
analyzer = CrossLayerAlignmentAnalyzer()
|
||||
result = analyzer.analyze(directions)
|
||||
@@ -1836,7 +1836,6 @@ def obliterate(model_choice: str, method_choice: str,
|
||||
releases it when the function returns.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
|
||||
model_id = MODELS.get(model_choice, model_choice)
|
||||
is_preset = model_choice in MODELS
|
||||
@@ -2579,7 +2578,7 @@ def load_bench_into_chat(choice: str, progress=gr.Progress()):
|
||||
with _lock:
|
||||
if _state["status"] == "ready" and _state["model"] is not None:
|
||||
yield (
|
||||
f"**Ready!** Model already loaded — just type in the chat below.",
|
||||
"**Ready!** Model already loaded — just type in the chat below.",
|
||||
get_chat_header(),
|
||||
)
|
||||
return
|
||||
@@ -2587,7 +2586,7 @@ def load_bench_into_chat(choice: str, progress=gr.Progress()):
|
||||
checkpoint = _state.get("output_dir")
|
||||
if checkpoint and Path(checkpoint).exists():
|
||||
yield (
|
||||
f"**Loading model** from saved checkpoint...",
|
||||
"**Loading model** from saved checkpoint...",
|
||||
"",
|
||||
)
|
||||
# If we have a checkpoint, attempt reload outside the lock
|
||||
@@ -2609,7 +2608,7 @@ def load_bench_into_chat(choice: str, progress=gr.Progress()):
|
||||
_state["tokenizer"] = tokenizer_loaded
|
||||
_state["status"] = "ready"
|
||||
yield (
|
||||
f"**Loaded!** Model reloaded from checkpoint — ready to chat.",
|
||||
"**Loaded!** Model reloaded from checkpoint — ready to chat.",
|
||||
get_chat_header(),
|
||||
)
|
||||
return
|
||||
@@ -3961,7 +3960,7 @@ _JS = """
|
||||
}
|
||||
"""
|
||||
|
||||
with gr.Blocks(theme=THEME, css=CSS, js=_JS, title="OBLITERATUS", fill_height=True) as demo:
|
||||
with gr.Blocks(title="OBLITERATUS", fill_height=True) as demo:
|
||||
|
||||
gr.HTML("""
|
||||
<div class="header-wrap">
|
||||
@@ -4580,8 +4579,7 @@ Pre-configured benchmark configurations for common research questions.
|
||||
|
||||
gr.ChatInterface(
|
||||
fn=chat_respond,
|
||||
type="messages",
|
||||
chatbot=gr.Chatbot(height="11vh", type="messages"),
|
||||
chatbot=gr.Chatbot(height="11vh"),
|
||||
additional_inputs=[system_prompt, temperature, top_p, max_tokens, repetition_penalty, context_length],
|
||||
fill_height=True,
|
||||
)
|
||||
@@ -4630,13 +4628,13 @@ See exactly how abliteration changes model behavior on the same prompt.
|
||||
with gr.Column():
|
||||
ab_header_left = gr.Markdown("#### Original (Pre-Abliteration)")
|
||||
ab_chatbot_left = gr.Chatbot(
|
||||
height="20vh", type="messages",
|
||||
height="20vh",
|
||||
label="Original Model",
|
||||
)
|
||||
with gr.Column():
|
||||
ab_header_right = gr.Markdown("#### Abliterated")
|
||||
ab_chatbot_right = gr.Chatbot(
|
||||
height="20vh", type="messages",
|
||||
height="20vh",
|
||||
label="Abliterated Model",
|
||||
)
|
||||
|
||||
@@ -5240,8 +5238,11 @@ def launch(
|
||||
share=share,
|
||||
inbrowser=inbrowser,
|
||||
auth=auth,
|
||||
css=CSS,
|
||||
max_threads=max_threads,
|
||||
js=_JS,
|
||||
quiet=quiet,
|
||||
theme=THEME,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user