remiai3's picture
Upload 9 files
6e793bd verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text-to-Code Generator</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: #f4f4f9;
}
.container {
max-width: 800px;
margin: auto;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
textarea {
width: 100%;
height: 100px;
margin-bottom: 10px;
padding: 10px;
border-radius: 4px;
border: 1px solid #ccc;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
pre {
background-color: #f8f9fa;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
}
.attribution {
margin-top: 20px;
font-size: 0.9em;
color: #555;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h1>Text-to-Code Generator</h1>
<form method="POST">
<textarea name="prompt" placeholder="Enter a prompt (e.g., 'Write a Python function to calculate factorial')" required>{{ prompt }}</textarea>
<button type="submit">Generate Code</button>
</form>
{% if generated_code %}
<h2>Generated Code:</h2>
<pre>{{ generated_code }}</pre>
{% endif %}
<div class="attribution">
<p>Built with the fine-tuned </a href="https://huggingface.co/Salesforce/codegen-350M-multi" target="_blank">Salesforce/codegen-350M-multi</a> model.</p>
<p>Developed by </a href="https://huggingface.co/remiai3" target="_blank">remiai3</a> for educational use. Licensed under Apache-2.0.</p>
<p>Free resources for students to experiment with AI model development.</p>
</div>
</div>
</body>
</html>