Spaces:
Runtime error
Runtime error
Upload 2 files
Browse filesFiles changed (2)
- templates/index.htmlAdded+70
- templates/login.htmlAdded+90
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chatbot Interface</title>
<!-- Include Bootstrap CSS for styling (optional) -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
body {
padding: 20px;
}
.chatbot-container {
max-width: 800px;
margin: auto;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.chatbot-container h1 {
text-align: center;
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="chatbot-container">
<h1>Question answering chatbot</h1>
<div id="chatbot-interface">
<!-- Chatbot UI will be dynamically added here -->
</div>
</div>
<iframe src="http://127.0.0.1:7865/" width="1500" height="1000" frameborder="0"></iframe>
<!-- Include Gradio JavaScript library -->
<script src="https://cdn.jsdelivr.net/npm/@gradio/chatbot"></script>
<script>
// Define function to initialize Gradio chatbot
function initializeChatbot() {
gr.Chatbot({
container: document.getElementById('chatbot-interface'),
steps: [
{
type: 'text',
name: 'input',
message: 'Enter your question or instruction here...',
},
{
type: 'model',
name: 'output',
model: 'http://127.0.0.1:7865/', // Replace with your actual chatbot endpoint
options: {
headers: {
'Authorization': 'Bearer your_auth_token', // If authentication is required
'Content-Type': 'application/json',
},
},
}
]
});
}
// Wait for DOM content to load before initializing chatbot
document.addEventListener('DOMContentLoaded', function() {
initializeChatbot();
});
</script>
</body>
</html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
<!-- Include Bootstrap CSS for styling (optional) -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
body {
background-color: #f0f0f0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-container {
max-width: 400px;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.login-container h2 {
text-align: center;
margin-bottom: 20px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
font-weight: bold;
}
.form-group input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.form-group button {
width: 100%;
padding: 10px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
.form-group button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<form id="loginForm">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
</div>
<div class="form-group">
<button type="submit">Login</button>
</div>
</form>
</div>
<!-- Script for handling form submission -->
<script>
document.getElementById('loginForm').addEventListener('submit', function(event) {
event.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
// Example validation (replace with your own logic)
if (username === 'admin' && password === 'password') {
// Redirect to main application page
window.location.href = 'index.html';
} else {
alert('Invalid username or password. Please try again.');
}
});
</script>
</body>
</html>templates/index.htmlAdded+70
templates/login.htmlAdded+90