EnhancerModel / README.md
ayjays132's picture
Update README.md
e779f10 verified
|
raw
history blame
14.5 kB
---
license: apache-2.0
library_name: transformers
---
<style>
/* General Styles */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&display=swap');
body {
font-family: 'Montserrat', sans-serif;
background-color: #121212;
margin: 0;
padding: 20px;
line-height: 1.6;
color: #e0e0e0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
border-radius: 10px;
background: rgba(255, 255, 255, 0.05);
}
.container {
max-width: 900px;
margin: 20px auto;
padding: 40px;
background-color: #1e1e1e;
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
overflow: hidden;
animation: fadeIn 1s ease-in-out;
border: 2px solid #333;
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.section {
margin-bottom: 60px;
padding: 20px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.05);
transition: background 0.3s ease, transform 0.3s ease;
}
.section:hover {
background: rgba(255, 255, 255, 0.1);
transform: translateY(-5px);
}
.section-header {
text-align: center;
margin-bottom: 40px;
animation: slideIn 1s ease-in-out;
border-bottom: 2px solid #333;
padding-bottom: 10px;
position: relative;
}
@keyframes slideIn {
0% {
transform: translateX(-100%);
opacity: 0;
}
100% {
transform: translateX(0);
opacity: 1;
}
}
.section-title {
font-size: 36px;
font-weight: 800;
margin-bottom: 20px;
text-transform: uppercase;
letter-spacing: 2px;
color: #e0e0e0;
animation: fadeIn 1s ease-in-out;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}
.section-description {
font-size: 18px;
line-height: 1.8;
color: #b0b0b0;
animation: fadeIn 1s ease-in-out;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
.detail {
display: flex;
align-items: center;
margin-bottom: 20px;
color: #e0e0e0;
animation: fadeIn 1s ease-in-out;
padding: 10px;
border-radius: 8px;
transition: background 0.3s ease, transform 0.3s ease;
}
.detail:hover {
background: rgba(255, 255, 255, 0.1);
transform: translateY(-5px);
}
.detail-icon {
margin-right: 12px;
font-size: 24px;
color: #007bff;
}
.detail-text {
font-size: 18px;
color: #e0e0e0;
}
.interactive-element {
position: relative;
width: 100%;
height: 300px;
border-radius: 20px;
overflow: hidden;
background: linear-gradient(135deg, #1e1e1e, #121212);
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
transition: transform 0.3s ease;
}
.interactive-element::before,
.interactive-element::after {
content: '';
position: absolute;
width: 100%;
height: 100%;
background: linear-gradient(135deg, rgba(255, 0, 0, 0.5), rgba(0, 0, 255, 0.5));
mix-blend-mode: screen;
animation: shimmer 5s infinite;
}
.interactive-element::before {
top: -100%;
left: 0;
animation-direction: alternate;
}
.interactive-element::after {
bottom: -100%;
right: 0;
animation-direction: alternate-reverse;
}
@keyframes shimmer {
0% {
transform: translateY(0);
}
100% {
transform: translateY(100%);
}
}
.interactive-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #e0e0e0;
font-size: 24px;
font-weight: 600;
text-align: center;
opacity: 0;
transition: opacity 0.5s ease-in-out;
}
.interactive-element:hover .interactive-message {
opacity: 1;
}
.form-container {
margin-top: 40px;
padding: 20px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.05);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
animation: fadeIn 1s ease-in-out;
position: relative;
overflow: hidden;
}
.form-container::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
animation: rotate 10s infinite linear;
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.form-title {
font-size: 28px;
font-weight: 700;
margin-bottom: 20px;
text-align: center;
color: #e0e0e0;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
.form-field {
margin-bottom: 20px;
}
.form-label {
display: block;
font-size: 16px;
margin-bottom: 5px;
color: #b0b0b0;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.form-input {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #333;
background: #1e1e1e;
color: #e0e0e0;
font-size: 16px;
transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-input:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
.form-button {
display: block;
width: 100%;
padding: 10px;
border-radius: 5px;
background: #007bff;
color: #e0e0e0;
font-size: 18px;
font-weight: 600;
text-align: center;
cursor: pointer;
transition: background 0.3s ease, transform 0.3s ease;
}
.form-button:hover {
background: #0056b3;
transform: translateY(-2px);
}
.widget-container {
background: rgba(255, 255, 255, 0.05);
border-radius: 10px;
padding: 20px;
margin-top: 40px;
animation: fadeIn 1s ease-in-out;
position: relative;
overflow: hidden;
}
.widget-container::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
animation: rotate 10s infinite linear;
}
.widget-header {
text-align: center;
font-size: 24px;
font-weight: 700;
color: #e0e0e0;
margin-bottom: 20px;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
.widget-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
color: #b0b0b0;
}
.widget-content p {
margin: 10px 0;
}
.trendy-feature {
background-color: #ffffff;
padding: 40px;
border-radius: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: transform 0.3s ease;
margin: 20px auto;
max-width: 600px;
}
.trendy-feature:hover {
transform: translateY(-5px);
}
.trendy-feature h1 {
font-size: 36px;
margin-bottom: 20px;
color: #333;
}
/* Global Styles */
body {
font-family: Arial, sans-serif;
color: #333;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.section-title {
font-size: 2rem;
margin-bottom: 20px;
color: #333;
text-align: center;
}
.section {
background-color: #fff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 40px;
padding: 20px;
}
.section-header {
border-bottom: 2px solid #eee;
margin-bottom: 20px;
padding-bottom: 10px;
}
.section-content {
display: flex;
flex-direction: column;
gap: 20px;
}
.detail {
display: flex;
align-items: flex-start;
gap: 10px;
}
.detail-icon {
font-size: 2rem;
color: #555;
}
.detail-text {
font-size: 1rem;
line-height: 1.5;
color: #555;
}
.section-description {
margin-bottom: 20px;
}
.detail-icon {
font-size: 1.5rem;
}
@media (max-width: 768px) {
.section-content {
flex-direction: column;
}
}
/* Container */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
font-family: 'Arial', sans-serif;
background-color: #f9f9f9;
border-radius: 12px;
box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease-in-out;
}
.container:hover {
box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.2);
}
/* Titles */
h1.section-title {
font-size: 32px;
font-weight: 700;
color: #333;
margin-bottom: 30px;
text-align: center;
}
h2.section-title {
font-size: 26px;
font-weight: 600;
color: #222;
margin-bottom: 20px;
position: relative;
padding-bottom: 10px;
}
h2.section-title::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 3px;
background-color: #ff5733;
}
/* Section */
.section {
margin-bottom: 40px;
padding: 20px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.05);
transition: transform 0.2s ease-in-out;
}
.section:hover {
transform: translateY(-5px);
}
/* Section Headers */
.section-header {
margin-bottom: 15px;
}
/* Detail */
.detail {
display: flex;
align-items: flex-start;
margin-bottom: 15px;
}
.detail:last-child {
margin-bottom: 0;
}
.detail-icon {
font-size: 24px;
margin-right: 15px;
color: #ff5733;
}
.detail-text {
font-size: 18px;
font-weight: 400;
color: #444;
line-height: 1.6;
max-width: 1000px;
}
.detail-text:hover {
color: #ff5733;
}
/* Section Content */
.section-content {
display: flex;
flex-direction: column;
}
/* Responsive Design */
@media (max-width: 768px) {
.section-content {
padding: 10px;
}
h1.section-title {
font-size: 28px;
}
h2.section-title {
font-size: 22px;
}
.detail-text {
font-size: 16px;
}
}
/* Hover Effects */
.section:hover .detail-icon {
color: #ff5733;
transform: rotate(360deg);
transition: all 0.4s ease;
}
/* Premium Text Styles */
.detail-text {
font-size: 18px;
font-weight: 400;
color: #333;
transition: color 0.3s ease;
}
.detail-text:hover {
color: #ff5733;
}
h1, h2 {
color: #222;
}
h1:hover, h2:hover {
color: #ff5733;
cursor: pointer;
}
/* Additional Spacing and Padding */
.container {
padding: 40px;
}
.section {
padding: 30px;
}
/* Borders and Layers */
.container {
border: 2px solid #ddd;
}
.section {
border: 1px solid #ccc;
}
/* Interactive Elements */
.section:hover {
background-color: #f4f4f4;
cursor: pointer;
}
/* Clear Button Hover Effects */
button {
background-color: #ff5733;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease-in-out;
}
button:hover {
background-color: #e04d2e;
transform: translateY(-3px);
}
button:focus {
outline: none;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
}
.model-description {
background: #fff;
border-radius: 8px;
padding: 20px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
max-width: 800px;
margin: auto;
}
.model-description h2 {
margin-top: 0;
color: #333;
}
.model-description p {
margin: 0 0 10px;
color: #666;
}
body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
}
.model-description {
background: #ffffff;
border-radius: 8px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
max-width: 800px;
margin: 20px auto;
}
.code-container {
background: #1e1e1e;
color: #dcdcdc;
border-radius: 8px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
max-width: 800px;
margin: 20px auto;
overflow-x: auto;
font-family: 'Courier New', Courier, monospace;
font-size: 16px;
line-height: 1.4;
}
code {
display: block;
white-space: pre-wrap;
word-break: break-word;
}
code::before {
content: " ";
display: block;
margin: 0 -20px;
padding: 10px;
background: #282c34;
border-radius: 8px 8px 0 0;
}
code::after {
content: " ";
display: block;
margin: 10px -20px;
padding: 10px;
background: #282c34;
border-radius: 0 0 8px 8px;
}
body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
}
.code-container {
background: #1e1e1e;
color: #dcdcdc;
border-radius: 8px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
max-width: 800px;
margin: 20px auto;
overflow-x: auto;
font-family: 'Courier New', Courier, monospace;
font-size: 16px;
line-height: 1.4;
}
pre {
margin: 0;
}
code {
display: block;
white-space: pre-wrap;
word-break: break-word;
}
</style>
<body>
<div class="section">
<div class="section-header">
<div class="model-description">
<h2 class="section-title">Enhanced Model Features</h2>
<p><strong>Adaptability:</strong> Adjusts to diverse contexts and user needs, ensuring relevant and precise interactions.</p>
<p><strong>Contextual Intelligence:</strong> Provides contextually aware responses, improving engagement and interaction quality.</p>
<p><strong>Advanced Algorithms:</strong> Employs cutting-edge algorithms for sophisticated and intelligent responses.</p>
<p><strong>User Experience:</strong> Designed with a focus on seamless interaction, offering an intuitive and refined user experience.</p>
</div>
</div>
<body>
<div class="code-container">
<pre><code>
from transformers import BartTokenizer, BartForConditionalGeneration
from datasets import load_dataset
# Load pre-trained BART model for summarization
tokenizer = BartTokenizer.from_pretrained('ayjays132/EnhancerModel')
model = BartForConditionalGeneration.from_pretrained('ayjays132/EnhancerModel')
# Load dataset
dataset = load_dataset("cnn_dailymail", "3.0.0")
# Function to generate summary
def summarize(text):
inputs = tokenizer(text, return_tensors="pt", max_length=1024, truncation=True)
summary_ids = model.generate(inputs['input_ids'], max_length=150, min_length=40, length_penalty=2.0, num_beams=4, early_stopping=True)
return tokenizer.decode(summary_ids[0], skip_special_tokens=True)
# Debugging: Print the type and content of the first example
print("Type of dataset['test']:", type(dataset['test']))
print("Type of the first element in dataset['test']:", type(dataset['test'][0]))
print("Content of the first element in dataset['test']:", dataset['test'][0])
# Test the model on a few examples
for example in dataset['test'][:5]:
try:
# If the example is a string, then it's likely that 'dataset['test']' is not loaded as expected
if isinstance(example, str):
print(f"Article: {example}\n")
print(f"Summary: {summarize(example)}\n")
else:
# Access the 'article' field if the example is a dictionary
article = example.get('article', None)
if article:
print(f"Article: {article}\n")
print(f"Summary: {summarize(article)}\n")
else:
print("No 'article' field found in this example.")
except Exception as e:
print(f"Error processing example: {e}")
</code></pre>
</div>
</body>