davidberenstein1957 commited on
Commit
ad140ce
Β·
verified Β·
1 Parent(s): 042b1fc

creaete a website for showcasing my trained guardrail models open source

Browse files
Files changed (6) hide show
  1. README.md +7 -4
  2. components/footer.js +84 -0
  3. components/header.js +83 -0
  4. index.html +133 -19
  5. script.js +35 -0
  6. style.css +28 -20
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Guardrail Galaxy Showcase
3
- emoji: πŸ†
4
  colorFrom: red
5
- colorTo: purple
 
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: Guardrail Galaxy Showcase 🚧
 
3
  colorFrom: red
4
+ colorTo: pink
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://huggingface.co/deepsite).
components/footer.js ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ footer {
7
+ background-color: #f9fafb;
8
+ }
9
+ .footer-link {
10
+ transition: color 0.2s ease;
11
+ }
12
+ .footer-link:hover {
13
+ color: var(--primary-600);
14
+ }
15
+ </style>
16
+ <footer class="border-t border-gray-200">
17
+ <div class="container mx-auto px-4 py-12">
18
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
19
+ <div>
20
+ <h3 class="text-lg font-semibold text-gray-900 mb-4">Guardrail Galaxy</h3>
21
+ <p class="text-gray-600 mb-4">
22
+ Open-source AI safety models for responsible deployment.
23
+ </p>
24
+ <div class="flex space-x-4">
25
+ <a href="https://github.com/guardrail-galaxy" class="text-gray-500 hover:text-gray-700">
26
+ <i data-feather="github" class="w-5 h-5"></i>
27
+ </a>
28
+ <a href="https://twitter.com/guardrailgalaxy" class="text-gray-500 hover:text-gray-700">
29
+ <i data-feather="twitter" class="w-5 h-5"></i>
30
+ </a>
31
+ <a href="https://discord.gg/guardrailgalaxy" class="text-gray-500 hover:text-gray-700">
32
+ <i data-feather="message-circle" class="w-5 h-5"></i>
33
+ </a>
34
+ </div>
35
+ </div>
36
+
37
+ <div>
38
+ <h3 class="text-lg font-semibold text-gray-900 mb-4">Models</h3>
39
+ <ul class="space-y-2">
40
+ <li><a href="/models/content-moderation" class="footer-link text-gray-600 hover:text-primary-600">Content Moderation</a></li>
41
+ <li><a href="/models/bias-detection" class="footer-link text-gray-600 hover:text-primary-600">Bias Detection</a></li>
42
+ <li><a href="/models/injection-protection" class="footer-link text-gray-600 hover:text-primary-600">Injection Protection</a></li>
43
+ <li><a href="/models/all" class="footer-link text-gray-600 hover:text-primary-600">All Models</a></li>
44
+ </ul>
45
+ </div>
46
+
47
+ <div>
48
+ <h3 class="text-lg font-semibold text-gray-900 mb-4">Resources</h3>
49
+ <ul class="space-y-2">
50
+ <li><a href="/docs" class="footer-link text-gray-600 hover:text-primary-600">Documentation</a></li>
51
+ <li><a href="/tutorials" class="footer-link text-gray-600 hover:text-primary-600">Tutorials</a></li>
52
+ <li><a href="/blog" class="footer-link text-gray-600 hover:text-primary-600">Blog</a></li>
53
+ <li><a href="/case-studies" class="footer-link text-gray-600 hover:text-primary-600">Case Studies</a></li>
54
+ </ul>
55
+ </div>
56
+
57
+ <div>
58
+ <h3 class="text-lg font-semibold text-gray-900 mb-4">Community</h3>
59
+ <ul class="space-y-2">
60
+ <li><a href="/community/contributing" class="footer-link text-gray-600 hover:text-primary-600">Contributing</a></li>
61
+ <li><a href="/community/forum" class="footer-link text-gray-600 hover:text-primary-600">Forum</a></li>
62
+ <li><a href="/community/events" class="footer-link text-gray-600 hover:text-primary-600">Events</a></li>
63
+ <li><a href="/community/support" class="footer-link text-gray-600 hover:text-primary-600">Support</a></li>
64
+ </ul>
65
+ </div>
66
+ </div>
67
+
68
+ <div class="border-t border-gray-200 mt-12 pt-8 flex flex-col md:flex-row justify-between items-center">
69
+ <p class="text-gray-500 text-sm mb-4 md:mb-0">
70
+ &copy; ${new Date().getFullYear()} Guardrail Galaxy. Open-source under MIT License.
71
+ </p>
72
+ <div class="flex space-x-6">
73
+ <a href="/privacy" class="text-gray-500 hover:text-gray-700 text-sm">Privacy Policy</a>
74
+ <a href="/terms" class="text-gray-500 hover:text-gray-700 text-sm">Terms of Service</a>
75
+ <a href="/license" class="text-gray-500 hover:text-gray-700 text-sm">License</a>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ </footer>
80
+ `;
81
+ }
82
+ }
83
+
84
+ customElements.define('custom-footer', CustomFooter);
components/header.js ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomHeader extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ nav {
7
+ background-color: white;
8
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
9
+ }
10
+ .nav-link {
11
+ transition: color 0.2s ease;
12
+ }
13
+ .nav-link:hover {
14
+ color: var(--primary-600);
15
+ }
16
+ .mobile-menu {
17
+ max-height: 0;
18
+ transition: max-height 0.3s ease-out;
19
+ overflow: hidden;
20
+ }
21
+ .mobile-menu.open {
22
+ max-height: 500px;
23
+ transition: max-height 0.5s ease-in;
24
+ }
25
+ </style>
26
+ <header>
27
+ <nav class="border-b border-gray-200">
28
+ <div class="container mx-auto px-4 py-4">
29
+ <div class="flex justify-between items-center">
30
+ <a href="/" class="flex items-center">
31
+ <span class="text-2xl font-bold gradient-text">Guardrail Galaxy</span>
32
+ </a>
33
+
34
+ <div class="hidden md:flex items-center space-x-8">
35
+ <a href="/models" class="nav-link text-gray-700 hover:text-primary-600 font-medium">Models</a>
36
+ <a href="/docs" class="nav-link text-gray-700 hover:text-primary-600 font-medium">Documentation</a>
37
+ <a href="/blog" class="nav-link text-gray-700 hover:text-primary-600 font-medium">Blog</a>
38
+ <a href="/community" class="nav-link text-gray-700 hover:text-primary-600 font-medium">Community</a>
39
+ <a href="https://github.com/guardrail-galaxy" class="flex items-center text-gray-700 hover:text-gray-900">
40
+ <i data-feather="github" class="w-5 h-5 mr-1"></i>
41
+ <span class="font-medium">GitHub</span>
42
+ </a>
43
+ </div>
44
+
45
+ <button id="mobile-menu-button" class="md:hidden text-gray-700">
46
+ <i data-feather="menu" class="w-6 h-6"></i>
47
+ </button>
48
+ </div>
49
+
50
+ <div id="mobile-menu" class="mobile-menu md:hidden mt-2">
51
+ <div class="pt-2 pb-4 space-y-1">
52
+ <a href="/models" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-primary-600 hover:bg-gray-50">Models</a>
53
+ <a href="/docs" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-primary-600 hover:bg-gray-50">Documentation</a>
54
+ <a href="/blog" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-primary-600 hover:bg-gray-50">Blog</a>
55
+ <a href="/community" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-primary-600 hover:bg-gray-50">Community</a>
56
+ <a href="https://github.com/guardrail-galaxy" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50 flex items-center">
57
+ <i data-feather="github" class="w-5 h-5 mr-2"></i>
58
+ <span>GitHub</span>
59
+ </a>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </nav>
64
+ </header>
65
+ `;
66
+
67
+ const mobileMenuButton = this.shadowRoot.getElementById('mobile-menu-button');
68
+ const mobileMenu = this.shadowRoot.getElementById('mobile-menu');
69
+
70
+ mobileMenuButton.addEventListener('click', () => {
71
+ const isOpen = mobileMenu.classList.contains('open');
72
+ if (isOpen) {
73
+ mobileMenu.classList.remove('open');
74
+ feather.replace();
75
+ } else {
76
+ mobileMenu.classList.add('open');
77
+ feather.replace();
78
+ }
79
+ });
80
+ }
81
+ }
82
+
83
+ customElements.define('custom-header', CustomHeader);
index.html CHANGED
@@ -1,19 +1,133 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Guardrail Galaxy | AI Safety Models</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
9
+ <script src="https://unpkg.com/feather-icons"></script>
10
+ <link rel="stylesheet" href="style.css">
11
+ <script>
12
+ tailwind.config = {
13
+ theme: {
14
+ extend: {
15
+ colors: {
16
+ primary: {
17
+ 50: '#f0f9ff',
18
+ 100: '#e0f2fe',
19
+ 500: '#3b82f6',
20
+ 600: '#2563eb',
21
+ },
22
+ secondary: {
23
+ 50: '#f5f3ff',
24
+ 100: '#ede9fe',
25
+ 500: '#8b5cf6',
26
+ 600: '#7c3aed',
27
+ }
28
+ }
29
+ }
30
+ }
31
+ }
32
+ </script>
33
+ </head>
34
+ <body class="bg-gray-50 min-h-screen">
35
+ <custom-header></custom-header>
36
+
37
+ <main class="container mx-auto px-4 py-12">
38
+ <section class="text-center mb-16">
39
+ <h1 class="text-4xl md:text-5xl font-bold text-gray-900 mb-4">Guardrail Galaxy</h1>
40
+ <p class="text-xl text-gray-600 max-w-3xl mx-auto">
41
+ Open-source AI safety models designed to keep your applications secure and aligned
42
+ </p>
43
+ </section>
44
+
45
+ <section class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-16">
46
+ <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow">
47
+ <img src="http://static.photos/technology/640x360/1" alt="Content Moderation Model" class="w-full h-48 object-cover">
48
+ <div class="p-6">
49
+ <h3 class="text-xl font-semibold text-gray-900 mb-2">Content Moderation</h3>
50
+ <p class="text-gray-600 mb-4">
51
+ Filters harmful or inappropriate content with 98% accuracy across multiple languages.
52
+ </p>
53
+ <a href="/models/content-moderation" class="text-primary-600 hover:text-primary-700 font-medium flex items-center">
54
+ View details <i data-feather="arrow-right" class="ml-2 w-4 h-4"></i>
55
+ </a>
56
+ </div>
57
+ </div>
58
+
59
+ <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow">
60
+ <img src="http://static.photos/finance/640x360/2" alt="Bias Detection Model" class="w-full h-48 object-cover">
61
+ <div class="p-6">
62
+ <h3 class="text-xl font-semibold text-gray-900 mb-2">Bias Detection</h3>
63
+ <p class="text-gray-600 mb-4">
64
+ Identifies and mitigates biases in text generation with explainable AI techniques.
65
+ </p>
66
+ <a href="/models/bias-detection" class="text-primary-600 hover:text-primary-700 font-medium flex items-center">
67
+ View details <i data-feather="arrow-right" class="ml-2 w-4 h-4"></i>
68
+ </a>
69
+ </div>
70
+ </div>
71
+
72
+ <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow">
73
+ <img src="http://static.photos/security/640x360/3" alt="Prompt Injection Protection" class="w-full h-48 object-cover">
74
+ <div class="p-6">
75
+ <h3 class="text-xl font-semibold text-gray-900 mb-2">Injection Protection</h3>
76
+ <p class="text-gray-600 mb-4">
77
+ Defends against prompt injection attacks with adaptive threat detection.
78
+ </p>
79
+ <a href="/models/injection-protection" class="text-primary-600 hover:text-primary-700 font-medium flex items-center">
80
+ View details <i data-feather="arrow-right" class="ml-2 w-4 h-4"></i>
81
+ </a>
82
+ </div>
83
+ </div>
84
+ </section>
85
+
86
+ <section class="bg-gradient-to-r from-primary-50 to-secondary-50 rounded-2xl p-8 md:p-12 mb-16">
87
+ <div class="max-w-4xl mx-auto text-center">
88
+ <h2 class="text-3xl font-bold text-gray-900 mb-6">Why Guardrail Models?</h2>
89
+ <p class="text-lg text-gray-700 mb-8">
90
+ Our open-source guardrail models provide essential safety layers for your AI applications,
91
+ ensuring responsible deployment while maintaining high performance.
92
+ </p>
93
+ <a href="/about" class="bg-primary-600 hover:bg-primary-700 text-white font-medium py-3 px-6 rounded-lg inline-flex items-center">
94
+ Learn More <i data-feather="chevron-right" class="ml-2 w-4 h-4"></i>
95
+ </a>
96
+ </div>
97
+ </section>
98
+
99
+ <section class="mb-16">
100
+ <h2 class="text-2xl font-bold text-gray-900 mb-8 text-center">Getting Started</h2>
101
+ <div class="bg-white rounded-xl shadow-md p-6">
102
+ <div class="overflow-x-auto">
103
+ <pre class="bg-gray-100 p-4 rounded-lg text-sm"><code class="language-bash"># Install the guardrail package
104
+ pip install guardrail-galaxy
105
+
106
+ # Use our content moderation model
107
+ from guardrail_galaxy import ContentModerator
108
+
109
+ moderator = ContentModerator()
110
+ result = moderator.check("Your text input here")
111
+ print(result.safe)</code></pre>
112
+ </div>
113
+ <div class="mt-4 flex flex-col sm:flex-row gap-4">
114
+ <a href="/docs" class="bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium py-2 px-4 rounded-lg flex-1 text-center">
115
+ Documentation
116
+ </a>
117
+ <a href="https://github.com/guardrail-galaxy" class="bg-gray-900 hover:bg-gray-800 text-white font-medium py-2 px-4 rounded-lg flex-1 text-center flex items-center justify-center">
118
+ <i data-feather="github" class="mr-2 w-4 h-4"></i> GitHub
119
+ </a>
120
+ </div>
121
+ </div>
122
+ </section>
123
+ </main>
124
+
125
+ <custom-footer></custom-footer>
126
+
127
+ <script src="components/header.js"></script>
128
+ <script src="components/footer.js"></script>
129
+ <script src="script.js"></script>
130
+ <script>feather.replace();</script>
131
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
132
+ </body>
133
+ </html>
script.js ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ // Smooth scrolling for anchor links
3
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
4
+ anchor.addEventListener('click', function (e) {
5
+ e.preventDefault();
6
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
7
+ behavior: 'smooth'
8
+ });
9
+ });
10
+ });
11
+
12
+ // Copy code block functionality
13
+ document.querySelectorAll('pre code').forEach(codeBlock => {
14
+ const parent = codeBlock.closest('pre');
15
+ const copyButton = document.createElement('button');
16
+ copyButton.className = 'copy-button absolute top-2 right-2 p-1 bg-gray-200 hover:bg-gray-300 rounded-md';
17
+ copyButton.innerHTML = '<i data-feather="copy" class="w-4 h-4"></i>';
18
+ parent.style.position = 'relative';
19
+ parent.appendChild(copyButton);
20
+
21
+ copyButton.addEventListener('click', () => {
22
+ navigator.clipboard.writeText(codeBlock.textContent)
23
+ .then(() => {
24
+ copyButton.innerHTML = '<i data-feather="check" class="w-4 h-4 text-green-600"></i>';
25
+ setTimeout(() => {
26
+ copyButton.innerHTML = '<i data-feather="copy" class="w-4 h-4"></i>';
27
+ feather.replace();
28
+ }, 2000);
29
+ })
30
+ .catch(err => {
31
+ console.error('Failed to copy: ', err);
32
+ });
33
+ });
34
+ });
35
+ });
style.css CHANGED
@@ -1,28 +1,36 @@
 
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
  }
10
-
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
-
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
 
 
 
 
28
  }
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
2
+
3
  body {
4
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
5
+ line-height: 1.5;
6
  }
7
 
8
+ /* Custom scrollbar */
9
+ ::-webkit-scrollbar {
10
+ width: 8px;
11
  }
12
+ ::-webkit-scrollbar-track {
13
+ background: #f1f1f1;
 
 
 
 
14
  }
15
+ ::-webkit-scrollbar-thumb {
16
+ background: #888;
17
+ border-radius: 4px;
18
+ }
19
+ ::-webkit-scrollbar-thumb:hover {
20
+ background: #555;
 
21
  }
22
 
23
+ /* Animation for cards */
24
+ .card-hover {
25
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
26
+ }
27
+ .card-hover:hover {
28
+ transform: translateY(-5px);
29
  }
30
+
31
+ /* Gradient text */
32
+ .gradient-text {
33
+ background: linear-gradient(45deg, #3b82f6, #8b5cf6);
34
+ -webkit-background-clip: text;
35
+ -webkit-text-fill-color: transparent;
36
+ }