Skip to content

Commit

Permalink
Static Website
Browse files Browse the repository at this point in the history
  • Loading branch information
javipacheco committed Nov 20, 2023
1 parent 7de7970 commit 0d9638b
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 20 deletions.
2 changes: 2 additions & 0 deletions evaluator/evalTest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
results.json
20 changes: 0 additions & 20 deletions evaluator/evalTest/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,6 @@
"Here is a recipe for a delicious chocolate cake:\n\nIngredients:\n- 2 cups all-purpose flour\n- 2 cups granulated sugar\n- 3/4 cup unsweetened cocoa powder\n- 1 1/2 teaspoons baking powder\n- 1 1/2 teaspoons baking soda\n- 1 teaspoon salt\n- 2 large eggs\n- 1 cup milk\n- 1/2 cup vegetable oil\n- 2 teaspoons vanilla extract\n- 1 cup boiling water\n\nFor the chocolate frosting:\n- 1/2 cup unsalted butter, softened\n- 2/3 cup unsweetened cocoa powder\n- 3 cups powdered sugar\n- 1/3 cup milk\n- 1 teaspoon vanilla extract\n\nInstructions:\n1. Preheat your oven to 350°F (175°C). Grease and flour two 9-inch round cake pans.\n\n2. In a large mixing bowl, combine the flour, sugar, cocoa powder, baking powder, baking soda, and salt. Mix well.\n\n3. Add the eggs, milk, vegetable oil, and vanilla extract to the dry ingredients. Beat on medium speed for about 2 minutes until the batter is smooth.\n\n4. Stir in the boiling water. The batter will be thin, but that's normal.\n\n5. Pour the batter evenly into the prepared cake pans.\n\n6. Bake in the preheated oven for 30 to 35 minutes, or until a toothpick inserted into the center comes out clean.\n\n7. Remove the cakes from the oven and let them cool in the pans for 10 minutes. Then, transfer them to a wire rack to cool completely.\n\n8. While the cakes are cooling, prepare the chocolate frosting. In a mixing bowl, cream the softened butter. Add the cocoa powder, powdered sugar, milk, and vanilla extract. Beat until smooth and creamy.\n\n9. Once the cakes are completely cooled, spread a layer of frosting on top of one cake layer. Place the second cake layer on top and frost the top and sides of the cake with the remaining frosting.\n\n10. Decorate the cake as desired with chocolate shavings, sprinkles, or fresh berries.\n\n11. Slice and serve the delicious homemade chocolate cake!\n\nEnjoy your homemade chocolate cake!",
"The movie is Jurassic Park"
]
},
{
"input": "Recipe for a chocolate cake2",
"context": [
"Contains instructions for making a cake"
],
"actual_outputs": [
"Here is a recipe for a delicious chocolate cake:\n\nIngredients:\n- 2 cups all-purpose flour\n- 2 cups granulated sugar\n- 3/4 cup unsweetened cocoa powder\n- 1 1/2 teaspoons baking powder\n- 1 1/2 teaspoons baking soda\n- 1 teaspoon salt\n- 2 large eggs\n- 1 cup milk\n- 1/2 cup vegetable oil\n- 2 teaspoons vanilla extract\n- 1 cup boiling water\n\nFor the chocolate frosting:\n- 1/2 cup unsalted butter, softened\n- 2/3 cup unsweetened cocoa powder\n- 3 cups powdered sugar\n- 1/3 cup milk\n- 1 teaspoon vanilla extract\n\nInstructions:\n1. Preheat your oven to 350°F (175°C). Grease and flour two 9-inch round cake pans.\n\n2. In a large mixing bowl, combine the flour, sugar, cocoa powder, baking powder, baking soda, and salt. Mix well.\n\n3. Add the eggs, milk, vegetable oil, and vanilla extract to the dry ingredients. Beat on medium speed for about 2 minutes until the batter is smooth.\n\n4. Stir in the boiling water. The batter will be thin, but that's normal.\n\n5. Pour the batter evenly into the prepared cake pans.\n\n6. Bake in the preheated oven for 30 to 35 minutes, or until a toothpick inserted into the center comes out clean.\n\n7. Remove the cakes from the oven and let them cool in the pans for 10 minutes. Then, transfer them to a wire rack to cool completely.\n\n8. While the cakes are cooling, prepare the chocolate frosting. In a mixing bowl, cream the softened butter. Add the cocoa powder, powdered sugar, milk, and vanilla extract. Beat until smooth and creamy.\n\n9. Once the cakes are completely cooled, spread a layer of frosting on top of one cake layer. Place the second cake layer on top and frost the top and sides of the cake with the remaining frosting.\n\n10. Decorate the cake as desired with chocolate shavings, sprinkles, or fresh berries.\n\n11. Slice and serve the delicious homemade chocolate cake!\n\nEnjoy your homemade chocolate cake!",
"The movie is Jurassic Park"
]
},
{
"input": "Recipe for a chocolate cake4",
"context": [
"Contains instructions for making a cake"
],
"actual_outputs": [
"Here is a recipe for a delicious chocolate cake:\n\nIngredients:\n- 2 cups all-purpose flour\n- 2 cups granulated sugar\n- 3/4 cup unsweetened cocoa powder\n- 1 1/2 teaspoons baking powder\n- 1 1/2 teaspoons baking soda\n- 1 teaspoon salt\n- 2 large eggs\n- 1 cup milk\n- 1/2 cup vegetable oil\n- 2 teaspoons vanilla extract\n- 1 cup boiling water\n\nFor the chocolate frosting:\n- 1/2 cup unsalted butter, softened\n- 2/3 cup unsweetened cocoa powder\n- 3 cups powdered sugar\n- 1/3 cup milk\n- 1 teaspoon vanilla extract\n\nInstructions:\n1. Preheat your oven to 350°F (175°C). Grease and flour two 9-inch round cake pans.\n\n2. In a large mixing bowl, combine the flour, sugar, cocoa powder, baking powder, baking soda, and salt. Mix well.\n\n3. Add the eggs, milk, vegetable oil, and vanilla extract to the dry ingredients. Beat on medium speed for about 2 minutes until the batter is smooth.\n\n4. Stir in the boiling water. The batter will be thin, but that's normal.\n\n5. Pour the batter evenly into the prepared cake pans.\n\n6. Bake in the preheated oven for 30 to 35 minutes, or until a toothpick inserted into the center comes out clean.\n\n7. Remove the cakes from the oven and let them cool in the pans for 10 minutes. Then, transfer them to a wire rack to cool completely.\n\n8. While the cakes are cooling, prepare the chocolate frosting. In a mixing bowl, cream the softened butter. Add the cocoa powder, powdered sugar, milk, and vanilla extract. Beat until smooth and creamy.\n\n9. Once the cakes are completely cooled, spread a layer of frosting on top of one cake layer. Place the second cake layer on top and frost the top and sides of the cake with the remaining frosting.\n\n10. Decorate the cake as desired with chocolate shavings, sprinkles, or fresh berries.\n\n11. Slice and serve the delicious homemade chocolate cake!\n\nEnjoy your homemade chocolate cake!",
"The movie is Jurassic Park"
]
}
]
}
13 changes: 13 additions & 0 deletions evaluator/evalTest/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tests</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="results-container"></div>
<script src="script.js"></script>
</body>
</html>
56 changes: 56 additions & 0 deletions evaluator/evalTest/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
document.addEventListener('DOMContentLoaded', function() {
fetch('results.json')
.then(response => response.json())
.then(data => displayResults(data));
});

function displayResults(data) {
const container = document.getElementById('results-container');
const comparisonDiv = document.createElement('div');
comparisonDiv.className = 'comparison-block';

data.results.forEach(block => {
const blockDiv = document.createElement('div');
blockDiv.className = 'test-block';

const blockTitle = document.createElement('h2');
blockTitle.textContent = block.description;
blockDiv.appendChild(blockTitle);

block.tests.forEach(test => {
const testDiv = document.createElement('div');
testDiv.className = 'test';

const inputP = document.createElement('p');
inputP.className = 'input';
inputP.textContent = `Input: ${test.input}`;
testDiv.appendChild(inputP);

const outputP = document.createElement('p');
outputP.className = 'output';
outputP.textContent = `Output: ${test.output}`;
outputP.addEventListener('click', () => outputP.classList.toggle('expanded'));
testDiv.appendChild(outputP);

const scoreP = document.createElement('p');
scoreP.className = 'score';
scoreP.textContent = `Score: ${test.score}`;
testDiv.appendChild(scoreP);

blockDiv.appendChild(testDiv);
});

const avgScore = document.createElement('p');
avgScore.className = 'avg-score';
avgScore.textContent = `Average Score: ${block.avg}`;
blockDiv.appendChild(avgScore);

container.appendChild(blockDiv);

const comparisonP = document.createElement('p');
comparisonP.textContent = `${block.description} -> ${block.avg}`;
comparisonDiv.appendChild(comparisonP);
});

container.appendChild(comparisonDiv);
}
72 changes: 72 additions & 0 deletions evaluator/evalTest/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}

#results-container {
width: 80%;
margin: 20px auto;
padding: 20px;
background-color: white;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.test-block {
margin-bottom: 20px;
padding: 15px;
border: 1px solid #ddd;
border-radius: 4px;
background-color: #f9f9f9;
}

.test-block h2 {
margin: 0 0 10px 0;
color: #333;
}

.test {
margin-bottom: 10px;
}

.test .input {
font-size: 1.1em;
color: #406398;
}

.test .output {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
color: #555;
}

.test .output.expanded {
white-space: normal;
}

.score {
color: #2a9d8f;
font-weight: bold;
}

.avg-score {
font-size: 1.2em;
font-weight: bold;
color: #e76f51;
margin-top: 15px;
text-align: center;
}

.comparison-block {
font-size: 1.2em;
margin-top: 30px;
padding: 15px;
background-color: #e9ecef;
border-radius: 4px;
color: #406398;
}

0 comments on commit 0d9638b

Please sign in to comment.