Skip to content

Commit

Permalink
A lot of stuff started to work. Temp fix. prompt templates are back
Browse files Browse the repository at this point in the history
  • Loading branch information
yukiarimo committed Mar 6, 2024
1 parent 29bd3af commit adf4e2d
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 154 deletions.
13 changes: 6 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head data-bs-theme="dark">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=yes, user-scalable=no">
<title>Yuna AI</title>
<meta name="theme-color" content="#212529">
<link rel="canonical" href="http://www.yuna-ai.live/">
Expand Down Expand Up @@ -85,7 +85,7 @@
<div class="collapse navbar-collapse" id="navcol-1">
<ul class="navbar-nav mx-auto">
<li class="nav-item"><a class="nav-link active btn btn-primary shadow" href="/">Home</a></li>
<li class="nav-item"><a class="nav-link" href="/services">Services and Pricing</a></li>
<li class="nav-item"><a class="nav-link" href="/services.html">Services and Pricing</a></li>
</ul><a class="btn btn-primary shadow" role="button" href="/yuna.html">Login</a>
</div>
</div>
Expand All @@ -105,13 +105,13 @@ <h1 class="fw-bold">The best solution for you and your customers</h1>
<div style="position: relative;flex: 0 0 45%;transform: translate3d(-15%, 35%, 0);"><img
class="/static/img-fluid rounded shadow w-100 fit-cover" data-bss-parallax=""
data-bss-parallax-speed="0.8"
src="/static/img/products/phone-screen.png?h=fce4fd8e26138d1b5fd8c63ef4f2e64c"></div>
src="/static/img/products/phone-screen.png" alt="Prompt Templates"></div>
<div style="position: relative;flex: 0 0 45%;transform: translate3d(-5%, 20%, 0);"><img
class="/static/img-fluid" data-bss-parallax="" data-bss-parallax-speed="0.4"
src="/static/img/yuna-girl.png?h=104fcc18ad179e4b0b9e0ee12b849bed"></div>
src="/static/img/yuna-girl.png" alt="Yuna"></div>
<div style="position: relative;flex: 0 0 60%;transform: translate3d(0, 0%, 0);"><img
class="/static/img-fluid" data-bss-parallax="" data-bss-parallax-speed="0.25"
src="/static/img/products/chat.png?h=fc1e51d44f18accfa3a90f81c9cfffe4"></div>
src="/static/img/products/chat.png" alt="Chat"></div>
</div>
</div>
</div>
Expand Down Expand Up @@ -387,7 +387,7 @@ <h3 class="fs-6 fw-bold">About</h3>
class="bs-icon-sm bs-icon-circle d-flex justify-content-center align-items-center bs-icon me-2"><span
class="bs-icon-sm bs-icon-circle shadow d-flex justify-content-center align-items-center me-2 bs-icon">
<!-- Add img-fluid class and set a max-height -->
<img src="/static/img/yuna-ai.png" alt="Yuna AI" class="/static/img-fluid" style="max-height: 45px;">
<img src="/static/img/yuna-ai.png" alt="Yuna" class="/static/img-fluid" style="max-height: 45px;">
</span></span><span>Yuna AI</span></div>
<p class="text-muted">Your personal AI girlfriend.</p>
</div><!-- End: Social Icons -->
Expand Down Expand Up @@ -480,7 +480,6 @@ <h5 class="modal-title" id="teamModalLabel">Meet Our Team</h5>
</div>

<script src="/static/js/bootstrap/bootstrap.bundle.min.js"></script>
<script src="/static/js/bootstrap/jquery.min.js"></script>
<script src="/static/js/bootstrap/script.min.js"></script>
</body>

Expand Down
7 changes: 5 additions & 2 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
from itsdangerous import URLSafeTimedSerializer
from flask_login import login_manager
from flask_compress import Compress

with open('static/config.json', 'r') as config_file:
config = json.load(config_file)
Expand All @@ -22,6 +23,7 @@ def __init__(self):
self.app.config['COMPRESS_ALGORITHM'] = ['br', 'gzip']
self.app.config['COMPRESS_LEVEL'] = 6
self.app.config['COMPRESS_MIMETYPES'] = ['text/html', 'text/css', 'text/xml', 'application/json', 'application/javascript']
Compress(self.app)
login_manager.init_app(self.app)
login_manager.login_view = 'main'
login_manager.user_loader(self.user_loader)
Expand Down Expand Up @@ -84,8 +86,8 @@ def configure_routes(self):
self.app.route('/message', methods=['POST'], endpoint='message')(lambda: handle_message_request(self.chat_generator, self.chat_history_manager))
self.app.route('/image', methods=['POST'], endpoint='image')(lambda: handle_image_request(self.chat_history_manager))
self.app.route('/audio', methods=['POST'], endpoint='audio')(lambda: handle_audio_request(self))
self.app.route('/logout', methods=['POST'])(self.logout)
self.app.route('/services', methods=['GET'], endpoint='services')(lambda: services(self))
self.app.route('/logout', methods=['GET'])(self.logout)
self.app.route('/services.html', methods=['GET'], endpoint='services')(lambda: services(self))

def custom_static(self, filename):
if not filename.startswith('static/') and not filename.startswith('/favicon.ico') and not filename.startswith('/manifest.json'):
Expand All @@ -98,6 +100,7 @@ def image_pwa(self):
@login_required
def logout(self):
logout_user()
print('User logged out')
return redirect(url_for('main'))

def main(self):
Expand Down
2 changes: 1 addition & 1 deletion lib/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def handle_audio_request(self):
except Exception as e:
return jsonify({'error': str(e)}), 500

async def handle_image_request(chat_history_manager):
def handle_image_request(chat_history_manager):
data = request.get_json()

if 'image' in data and 'task' in data and data['task'] == 'caption':
Expand Down
19 changes: 11 additions & 8 deletions login.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

<head data-bs-theme="dark">
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, shrink-to-fit=no, maximum-scale=1.0, user-scalable=no">
<title>Yuna AI | Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=yes, user-scalable=no">
<title>Yuna AI</title>
<meta name="theme-color" content="#212529">
<link rel="canonical" href="http://www.yuna-ai.live/">
<meta property="og:url" content="http://www.yuna-ai.live/">
Expand All @@ -26,7 +25,7 @@
"url": "http://www.yuna-ai.live"
}
</script>
<link rel="icon" type="image/jpeg" sizes="60x60" href="img/yuna-ai.png">
<link rel="icon" type="image/jpeg" sizes="60x60" href="/static/img/yuna-ai.png">
<link rel="manifest" href="/static/manifest.json">
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/css/awesome.css">
Expand All @@ -45,6 +44,11 @@
font-style: normal;
font-weight: normal;
}

img {
height: 300px;
width: auto;
}
</style>

<script>
Expand All @@ -63,7 +67,7 @@
});
}
</script>
</head
</head>

<body class="bg-gradient-primary">
<div class="container">
Expand Down Expand Up @@ -156,9 +160,8 @@ <h2 class="text-center text-dark mb-4">Delete Account</h2>
</div>
</div>

<script src="/js/bootstrap/bootstrap.bundle.min.js"></script>
<script src="/js/bootstrap/jquery.min.js"></script>
<script src="/js/bootstrap/script.min.js"></script>
<script src="/static/js/bootstrap/bootstrap.bundle.min.js"></script>
<script src="/static/js/bootstrap/script.min.js"></script>
</body>

</html>
38 changes: 20 additions & 18 deletions services.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@

<head data-bs-theme="dark">
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, shrink-to-fit=no, maximum-scale=1.0, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=yes, user-scalable=no">
<title>Yuna AI</title>
<meta name="theme-color" content="#212529">
<link rel="canonical" href="http://www.yuna-ai.live/">
<meta property="og:url" content="http://www.yuna-ai.live/">
<meta property="og:description" content="Your virtual AI girlfriend">
<meta name="twitter:image" content="http://www.yuna-ai.live/img/yuna-ai.png">
<meta name="twitter:image" content="http://www.yuna-ai.live/static/img/yuna-ai.png">
<meta name="twitter:title" content="Yuna AI">
<meta property="og:image" content="http://www.yuna-ai.live/img/yuna-ai.png">
<meta property="og:image" content="http://www.yuna-ai.live/static/img/yuna-ai.png">
<meta name="description" content="Your virtual AI girlfriend">
<meta property="og:type" content="website">
<meta property="og:title" content="Yuna AI">
Expand All @@ -26,11 +25,10 @@
"url": "http://www.yuna-ai.live"
}
</script>
<link rel="icon" type="image/jpeg" sizes="60x60" href="img/yuna-ai.png">
<link rel="icon" type="image/jpeg" sizes="60x60" href="/static/img/yuna-ai.png">
<link rel="manifest" href="/static/manifest.json">
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="manifest" href="manifest.json">
<link rel="stylesheet" href="/css/awesome.css">
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/css/awesome.css">
<style>
* {
font-family: "kawai-font" !important;
Expand All @@ -42,10 +40,15 @@

@font-face {
font-family: "kawai-font";
src: url("../fonts/kawai-font.woff") format("woff");
src: url("/static/fonts/kawai-font.woff") format("woff");
font-style: normal;
font-weight: normal;
}

img {
height: 300px;
width: auto;
}
</style>

<script>
Expand Down Expand Up @@ -73,15 +76,15 @@
<span
class="bs-icon-sm bs-icon-circle shadow d-flex justify-content-center align-items-center me-2 bs-icon">
<!-- Add img-fluid class and set a max-height -->
<img src="img/yuna-ai.png" alt="Yuna AI" class="img-fluid" style="max-height: 45px;">
<img src="/static/img/yuna-ai.png" alt="Yuna AI" class="img-fluid" style="max-height: 45px;">
</span>
<span>Yuna AI</span>
</a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navcol-1"><span
class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navcol-1">
<ul class="navbar-nav mx-auto">
<li class="nav-item"><a class="nav-link" href="/">Home</a></li>
<li class="nav-item"><a class="nav-link active btn btn-primary shadow" href="/services">Services and Pricing</a></li>
<li class="nav-item"><a class="nav-link active btn btn-primary shadow" href="/services.html">Services and Pricing</a></li>
</ul><a class="btn btn-primary shadow" role="button" href="/yuna.html">Login</a>
</div>
</div>
Expand All @@ -97,7 +100,7 @@ <h3 class="fw-bold">What we can do for you</h3>
</div>
<div class="row row-cols-1 row-cols-md-2 mx-auto" style="max-width: 900px;">
<div class="col mb-5"><img class="rounded img-fluid shadow"
src="img/products/history.png?h=fc1e51d44f18accfa3a90f81c9cfffe4"></div>
src="/static/img/products/history.png" alt="History"></div>
<div class="col d-md-flex align-items-md-end align-items-lg-center mb-5">
<div>
<h5 class="fw-bold">Advanced History Managment&nbsp;</h5>
Expand All @@ -110,7 +113,7 @@ <h5 class="fw-bold">Advanced History Managment&nbsp;</h5>
</div>
<div class="row row-cols-1 row-cols-md-2 mx-auto" style="max-width: 900px;">
<div class="col order-md-last mb-5"><img class="rounded img-fluid shadow"
src="img/products/prompts.png?h=104fcc18ad179e4b0b9e0ee12b849bed"></div>
src="/static/img/products/prompts.png" alt="Prompts"></div>
<div class="col d-md-flex align-items-md-end align-items-lg-center mb-5">
<div>
<h5 class="fw-bold">Pre-built prompt templates&nbsp;</h5>
Expand All @@ -123,7 +126,7 @@ <h5 class="fw-bold">Pre-built prompt templates&nbsp;</h5>
</div>
<div class="row row-cols-1 row-cols-md-2 mx-auto" style="max-width: 900px;">
<div class="col mb-5"><img class="rounded img-fluid shadow"
src="img/products/profiles.png?h=fce4fd8e26138d1b5fd8c63ef4f2e64c"></div>
src="/static/img/products/profiles.png" alt="Profiles"></div>
<div class="col d-md-flex align-items-md-end align-items-lg-center mb-5">
<div>
<h5 class="fw-bold">Custom profiles&nbsp;</h5>
Expand Down Expand Up @@ -279,7 +282,7 @@ <h3 class="fs-6 fw-bold">About</h3>
class="bs-icon-sm bs-icon-circle d-flex justify-content-center align-items-center bs-icon me-2"><span
class="bs-icon-sm bs-icon-circle shadow d-flex justify-content-center align-items-center me-2 bs-icon">
<!-- Add img-fluid class and set a max-height -->
<img src="img/yuna-ai.png" alt="Yuna AI" class="img-fluid" style="max-height: 45px;">
<img src="/static/img/yuna-ai.png" alt="Yuna AI" class="img-fluid" style="max-height: 45px;">
</span></span><span>Yuna AI</span></div>
<p class="text-muted">Your personal AI girlfriend.</p>
</div><!-- End: Social Icons -->
Expand Down Expand Up @@ -369,9 +372,8 @@ <h5 class="modal-title" id="teamModalLabel">Meet Our Team</h5>
</div>
</div>

<script src="/js/bootstrap/bootstrap.bundle.min.js"></script>
<script src="/js/bootstrap/jquery.min.js"></script>
<script src="/js/bootstrap/script.min.js"></script>
<script src="/static/js/bootstrap/bootstrap.bundle.min.js"></script>
<script src="/static/js/bootstrap/script.min.js"></script>
</body>

</html>
10 changes: 2 additions & 8 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@
<loc>http://www.yuna-ai.live/</loc>
</url>
<url>
<loc>http://www.yuna-ai.live/pricing.html</loc>
<loc>http://www.yuna-ai.live/services.html</loc>
</url>
<url>
<loc>http://www.yuna-ai.live/services</loc>
</url>
<url>
<loc>http://www.yuna-ai.live/main</loc>
</url>
<url>
<loc>http://www.yuna-ai.live/yuna</loc>
<loc>http://www.yuna-ai.live/yuna.html</loc>
</url>
</urlset>
15 changes: 6 additions & 9 deletions static/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,22 @@
"emotions": false,
"art": false,
"max_new_tokens": 128,
"context_length": 1024,
"context_length": 1536,
"temperature": 0.6,
"repetition_penalty": 1.2,
"repetition_penalty": 1.11,
"last_n_tokens": 128,
"seed": -1,
"top_k": 40,
"top_p": 0.92,
"stop": [
"Yuki:",
"\nYuki: ",
"\nYou:",
"\nYou: ",
"\nYuna: ",
"\nYuki:",
"\nYuna:",
"Yuuki: ",
"Yuna:",
"Yuuki:",
"<|user|>",
"<|system|>",
"<|model|>",
"Yuna:"
"<|model|>"
],
"stream": false,
"batch_size": 128,
Expand Down
6 changes: 1 addition & 5 deletions static/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ body {
}

#msgCol {
background-image: url('/static/img/test-d.png');
background-image: url('/static/img/background.webp');
background-size: cover;
background-repeat: no-repeat;
background-position: center top;
Expand Down Expand Up @@ -707,10 +707,6 @@ body::-webkit-scrollbar {
z-index: 99999999;
width: 100%;
}

#msgCol {
background-image: url('/static/img/test.png');
}
}

#wrapper #content-wrapper {
Expand Down
Binary file added static/img/background.webp
Binary file not shown.
Binary file removed static/img/test-3d.png
Binary file not shown.
Binary file removed static/img/test-d.png
Binary file not shown.
Binary file removed static/img/test.png
Binary file not shown.
2 changes: 0 additions & 2 deletions static/js/bootstrap/jquery.min.js

This file was deleted.

10 changes: 6 additions & 4 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ class messageManager {
.then(data => {
this.removeTypingBubble();
const imageCaption = `*You can see ${data.message} in the image* ${messageForImage}`;
return imageCaption; // You might want to do something with this caption

this.removeTypingBubble();
this.createMessage(name2, imageCaption);

return imageCaption;
})
.catch(error => {
console.error('Error:', error);
Expand Down Expand Up @@ -485,13 +489,11 @@ async function captureImageViaFile() {
body: JSON.stringify({ image: imageDataURL, name: imageName, task: 'caption' })
});

if (!response.ok) throw new Error('Error sending uploaded image.');

const data = await response.json();
const imageCaption = data.message;
const askYunaImage = `*You can see ${imageCaption} in the image* ${messageForImage}`;

sendMessage(askYunaImage, imageName);
messageManager.sendMessage(askYunaImage, imageName, '/message');
} catch (error) {
console.error('Error:', error);
alert('Error sending uploaded image.');
Expand Down
Loading

0 comments on commit adf4e2d

Please sign in to comment.