Spaces:
Paused
Paused
Update index.html
Browse files- index.html +62 -50
index.html
CHANGED
|
@@ -4,74 +4,86 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Video Assistant</title>
|
| 7 |
-
<link href="https://fonts.googleapis.com/css2?family=
|
| 8 |
-
<
|
| 9 |
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/css/flag-icon.min.css">
|
| 10 |
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animated.css/1.1.1/animated.min.css">
|
| 11 |
<script src="https://cdn.jsdelivr.net/npm/@gradio/client/dist/index.min.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
</head>
|
| 13 |
-
<body class="bg-
|
| 14 |
-
<div class="container
|
| 15 |
-
<div class="
|
| 16 |
-
<h1 class="text-3xl font-bold text-
|
| 17 |
-
|
| 18 |
-
<div class="
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
</svg>
|
| 24 |
<span>User: Idle</span>
|
| 25 |
</div>
|
| 26 |
-
<div
|
| 27 |
-
<svg class="w-
|
| 28 |
-
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
|
| 29 |
-
<polyline points="2 17 12 22 22 17"></polyline>
|
| 30 |
-
<polyline points="2 12 12 17 22 12"></polyline>
|
| 31 |
-
</svg>
|
| 32 |
<span>AI: Idle</span>
|
| 33 |
</div>
|
| 34 |
</div>
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
| 43 |
</button>
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
<
|
|
|
|
| 48 |
<option value="Amy">Female</option>
|
| 49 |
<option value="Brian">Male</option>
|
| 50 |
</select>
|
| 51 |
-
<
|
|
|
|
|
|
|
| 52 |
</div>
|
| 53 |
-
<div class="
|
| 54 |
-
<label for="modelSelect" class="block font-medium text-gray-700">Model:</label>
|
| 55 |
-
<select id="modelSelect" class="w-full
|
| 56 |
<option value="8b">Fastest</option>
|
| 57 |
<option value="70b">Powerful</option>
|
| 58 |
</select>
|
| 59 |
-
<
|
|
|
|
|
|
|
| 60 |
</div>
|
| 61 |
-
<div
|
| 62 |
-
<label for="apiKey" class="block font-medium text-gray-700">SambaNava API Key
|
| 63 |
-
<input type="password" id="apiKey" class="w-full
|
| 64 |
-
<span class="tooltip text-sm text-gray-500">Use SambaNova API key for enhanced speed. You can obtain a free key from <a href="https://cloud.sambanova.ai/apis" class="text-blue-500">https://cloud.sambanova.ai/apis</a>.</span>
|
| 65 |
</div>
|
| 66 |
</div>
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
<!-- Webcam Integration -->
|
| 72 |
-
<div class="webcam-container mt-8">
|
| 73 |
<h2 class="text-xl font-semibold mb-2">Webcam Feed</h2>
|
| 74 |
-
<
|
|
|
|
|
|
|
| 75 |
</div>
|
| 76 |
</div>
|
| 77 |
</div>
|
|
@@ -85,7 +97,7 @@
|
|
| 85 |
existingScript.remove();
|
| 86 |
}
|
| 87 |
var script = document.createElement('script');
|
| 88 |
-
script.type = 'module';
|
| 89 |
if (isChrome && isDesktop) {
|
| 90 |
script.src = 'script1.js';
|
| 91 |
} else {
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Video Assistant</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
|
|
|
|
|
| 9 |
<script src="https://cdn.jsdelivr.net/npm/@gradio/client/dist/index.min.js"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
| 11 |
+
<script>
|
| 12 |
+
tailwind.config = {
|
| 13 |
+
theme: {
|
| 14 |
+
extend: {
|
| 15 |
+
colors: {
|
| 16 |
+
primary: '#4a90e2',
|
| 17 |
+
secondary: '#f39c12',
|
| 18 |
+
accent: '#38cb96',
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
</script>
|
| 24 |
</head>
|
| 25 |
+
<body class="bg-gray-100 font-sans">
|
| 26 |
+
<div class="container mx-auto px-4 py-8">
|
| 27 |
+
<div class="bg-white rounded-lg shadow-lg p-6 md:p-8" x-data="{ isListening: false }">
|
| 28 |
+
<h1 class="text-3xl font-bold text-center text-primary mb-6">Video Assistant</h1>
|
| 29 |
+
|
| 30 |
+
<div class="text-sm text-gray-600 text-center mb-4" id="responseTime">Latency: 0ms</div>
|
| 31 |
+
|
| 32 |
+
<div class="flex justify-center space-x-4 mb-6">
|
| 33 |
+
<div class="bg-primary text-white px-4 py-2 rounded-full flex items-center" id="userIndicator">
|
| 34 |
+
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path></svg>
|
|
|
|
| 35 |
<span>User: Idle</span>
|
| 36 |
</div>
|
| 37 |
+
<div class="bg-secondary text-white px-4 py-2 rounded-full flex items-center" id="aiIndicator">
|
| 38 |
+
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"></path></svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
<span>AI: Idle</span>
|
| 40 |
</div>
|
| 41 |
</div>
|
| 42 |
+
|
| 43 |
+
<button
|
| 44 |
+
id="startStopButton"
|
| 45 |
+
class="bg-accent hover:bg-accent-dark text-white font-bold py-3 px-6 rounded-full transition duration-300 ease-in-out transform hover:-translate-y-1 hover:shadow-lg flex items-center justify-center mx-auto mb-6"
|
| 46 |
+
@click="isListening = !isListening"
|
| 47 |
+
:class="{ 'bg-red-500 hover:bg-red-600': isListening }"
|
| 48 |
+
>
|
| 49 |
+
<svg class="w-6 h-6 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"></path></svg>
|
| 50 |
+
<span x-text="isListening ? 'Stop Listening' : 'Start Listening'"></span>
|
| 51 |
</button>
|
| 52 |
+
|
| 53 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
|
| 54 |
+
<div class="relative">
|
| 55 |
+
<label for="voiceSelect" class="block text-sm font-medium text-gray-700 mb-1">Voice:</label>
|
| 56 |
+
<select id="voiceSelect" class="block w-full bg-white border border-gray-300 rounded-md py-2 px-3 focus:outline-none focus:ring-primary focus:border-primary">
|
| 57 |
<option value="Amy">Female</option>
|
| 58 |
<option value="Brian">Male</option>
|
| 59 |
</select>
|
| 60 |
+
<div class="absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none">
|
| 61 |
+
<svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>
|
| 62 |
+
</div>
|
| 63 |
</div>
|
| 64 |
+
<div class="relative">
|
| 65 |
+
<label for="modelSelect" class="block text-sm font-medium text-gray-700 mb-1">Model:</label>
|
| 66 |
+
<select id="modelSelect" class="block w-full bg-white border border-gray-300 rounded-md py-2 px-3 focus:outline-none focus:ring-primary focus:border-primary">
|
| 67 |
<option value="8b">Fastest</option>
|
| 68 |
<option value="70b">Powerful</option>
|
| 69 |
</select>
|
| 70 |
+
<div class="absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none">
|
| 71 |
+
<svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>
|
| 72 |
+
</div>
|
| 73 |
</div>
|
| 74 |
+
<div>
|
| 75 |
+
<label for="apiKey" class="block text-sm font-medium text-gray-700 mb-1">SambaNava API Key:</label>
|
| 76 |
+
<input type="password" id="apiKey" placeholder="Enter your API Key" class="block w-full bg-white border border-gray-300 rounded-md py-2 px-3 focus:outline-none focus:ring-primary focus:border-primary">
|
|
|
|
| 77 |
</div>
|
| 78 |
</div>
|
| 79 |
+
|
| 80 |
+
<div id="transcript" class="bg-gray-100 rounded-lg p-4 text-sm font-mono h-40 overflow-y-auto mb-6"></div>
|
| 81 |
+
|
| 82 |
+
<div class="webcam-container">
|
|
|
|
|
|
|
| 83 |
<h2 class="text-xl font-semibold mb-2">Webcam Feed</h2>
|
| 84 |
+
<div class="relative w-full h-0 pb-[56.25%]">
|
| 85 |
+
<video id="webcam" autoplay playsinline class="absolute top-0 left-0 w-full h-full object-cover rounded-lg"></video>
|
| 86 |
+
</div>
|
| 87 |
</div>
|
| 88 |
</div>
|
| 89 |
</div>
|
|
|
|
| 97 |
existingScript.remove();
|
| 98 |
}
|
| 99 |
var script = document.createElement('script');
|
| 100 |
+
script.type = 'module';
|
| 101 |
if (isChrome && isDesktop) {
|
| 102 |
script.src = 'script1.js';
|
| 103 |
} else {
|