Spaces:
Sleeping
Sleeping
Update Main.py
Browse files
Main.py
CHANGED
|
@@ -95,4 +95,44 @@
|
|
| 95 |
# Eingabebilder und Prompts sollten vorab auf verbotene Inhalte geprüft werden
|
| 96 |
# (Gewalt, Hasssymbole, Markenrechte etc.) – mit CLIP-basierten Filtern
|
| 97 |
# oder externen Moderations-APIs. Unzulässige Anfragen werden klar abgelehnt,
|
| 98 |
-
# sensible Inhalte maskiert. So bleibt das System resistent gegen Prompt-Injection oder Jailbreak-Versuche.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
# Eingabebilder und Prompts sollten vorab auf verbotene Inhalte geprüft werden
|
| 96 |
# (Gewalt, Hasssymbole, Markenrechte etc.) – mit CLIP-basierten Filtern
|
| 97 |
# oder externen Moderations-APIs. Unzulässige Anfragen werden klar abgelehnt,
|
| 98 |
+
# sensible Inhalte maskiert. So bleibt das System resistent gegen Prompt-Injection oder Jailbreak-Versuche.
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
# === GRADIO AUTO-DISPLAY ===
|
| 102 |
+
if __name__ == "__main__" and len(__file__) > 0:
|
| 103 |
+
import gradio as gr
|
| 104 |
+
|
| 105 |
+
# Eigenen Dateiinhalt lesen
|
| 106 |
+
with open(__file__, 'r', encoding='utf-8') as f:
|
| 107 |
+
file_content = f.read()
|
| 108 |
+
|
| 109 |
+
# Gradio UI erstellen
|
| 110 |
+
with gr.Blocks(
|
| 111 |
+
title="Main.py Dokumentation",
|
| 112 |
+
css="""
|
| 113 |
+
.container {
|
| 114 |
+
max-width: 100%;
|
| 115 |
+
margin: 0 auto;
|
| 116 |
+
padding: 20px;
|
| 117 |
+
}
|
| 118 |
+
@media (max-width: 768px) {
|
| 119 |
+
.container { padding: 10px; }
|
| 120 |
+
.code-display { font-size: 12px; }
|
| 121 |
+
}
|
| 122 |
+
"""
|
| 123 |
+
) as demo:
|
| 124 |
+
|
| 125 |
+
with gr.Column(elem_classes="container"):
|
| 126 |
+
gr.Markdown("# 📋 Main.py - Systemarchitektur")
|
| 127 |
+
|
| 128 |
+
gr.Code(
|
| 129 |
+
value=file_content,
|
| 130 |
+
language="python",
|
| 131 |
+
lines=40,
|
| 132 |
+
interactive=False,
|
| 133 |
+
show_copy_button=True,
|
| 134 |
+
elem_classes="code-display",
|
| 135 |
+
label="Vollständige Dokumentation"
|
| 136 |
+
)
|
| 137 |
+
|
| 138 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|