Spaces:
Sleeping
Sleeping
Tony363 commited on
Commit ·
17d24fc
1
Parent(s): 24ae720
get templates and css
Browse files- static/dog.png +0 -0
- static/main.css +66 -0
- templates/index.html +22 -0
- templates/json_out.html +17 -0
- templates/upload_image.html +25 -0
static/dog.png
ADDED
|
static/main.css
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@font-face {
|
| 2 |
+
font-family: "ColfaxAI";
|
| 3 |
+
src: url(https://cdn.openai.com/API/fonts/ColfaxAIRegular.woff2)
|
| 4 |
+
format("woff2"),
|
| 5 |
+
url(https://cdn.openai.com/API/fonts/ColfaxAIRegular.woff) format("woff");
|
| 6 |
+
font-weight: normal;
|
| 7 |
+
font-style: normal;
|
| 8 |
+
}
|
| 9 |
+
@font-face {
|
| 10 |
+
font-family: "ColfaxAI";
|
| 11 |
+
src: url(https://cdn.openai.com/API/fonts/ColfaxAIBold.woff2) format("woff2"),
|
| 12 |
+
url(https://cdn.openai.com/API/fonts/ColfaxAIBold.woff) format("woff");
|
| 13 |
+
font-weight: bold;
|
| 14 |
+
font-style: normal;
|
| 15 |
+
}
|
| 16 |
+
body,
|
| 17 |
+
input {
|
| 18 |
+
font-size: 16px;
|
| 19 |
+
line-height: 24px;
|
| 20 |
+
color: #353740;
|
| 21 |
+
font-family: "ColfaxAI", Helvetica, sans-serif;
|
| 22 |
+
}
|
| 23 |
+
body {
|
| 24 |
+
display: flex;
|
| 25 |
+
flex-direction: column;
|
| 26 |
+
align-items: center;
|
| 27 |
+
padding-top: 60px;
|
| 28 |
+
}
|
| 29 |
+
.icon {
|
| 30 |
+
width: 34px;
|
| 31 |
+
}
|
| 32 |
+
h3 {
|
| 33 |
+
font-size: 32px;
|
| 34 |
+
line-height: 40px;
|
| 35 |
+
font-weight: bold;
|
| 36 |
+
color: #202123;
|
| 37 |
+
margin: 16px 0 40px;
|
| 38 |
+
}
|
| 39 |
+
form {
|
| 40 |
+
display: flex;
|
| 41 |
+
flex-direction: column;
|
| 42 |
+
width: 320px;
|
| 43 |
+
}
|
| 44 |
+
input[type="text"] {
|
| 45 |
+
padding: 12px 16px;
|
| 46 |
+
border: 1px solid #10a37f;
|
| 47 |
+
border-radius: 4px;
|
| 48 |
+
margin-bottom: 24px;
|
| 49 |
+
}
|
| 50 |
+
::placeholder {
|
| 51 |
+
color: #8e8ea0;
|
| 52 |
+
opacity: 1;
|
| 53 |
+
}
|
| 54 |
+
input[type="submit"] {
|
| 55 |
+
padding: 12px 0;
|
| 56 |
+
color: #fff;
|
| 57 |
+
background-color: #10a37f;
|
| 58 |
+
border: none;
|
| 59 |
+
border-radius: 4px;
|
| 60 |
+
text-align: center;
|
| 61 |
+
cursor: pointer;
|
| 62 |
+
}
|
| 63 |
+
.result {
|
| 64 |
+
font-weight: bold;
|
| 65 |
+
margin-top: 40px;
|
| 66 |
+
}
|
templates/index.html
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<title>OpenAI Quickstart</title>
|
| 5 |
+
<link
|
| 6 |
+
rel="shortcut icon"
|
| 7 |
+
href="{{ url_for('static', path='/dog.png') }}"
|
| 8 |
+
/>
|
| 9 |
+
<link rel="stylesheet" href="{{ url_for('static', path='/main.css') }}" />
|
| 10 |
+
</head>
|
| 11 |
+
<body>
|
| 12 |
+
<img src="{{ url_for('static', path='/dog.png') }}" class="icon" />
|
| 13 |
+
<h3>Name my pet</h3>
|
| 14 |
+
<form action="/" method="post">
|
| 15 |
+
<input type="text" name="animal" placeholder="Enter an animal" autocomplete="off" required />
|
| 16 |
+
<input type="submit" value="Generate names" />
|
| 17 |
+
</form>
|
| 18 |
+
{% if result %}
|
| 19 |
+
<div class="result">{{ result }}</div>
|
| 20 |
+
{% endif %}
|
| 21 |
+
</body>
|
| 22 |
+
</html>
|
templates/json_out.html
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>{{ data.on}}</title>
|
| 7 |
+
</head>
|
| 8 |
+
<body>
|
| 9 |
+
<h1>{{ data.prompts }}</h1>
|
| 10 |
+
<p>{{ data.score }}</p>
|
| 11 |
+
<!-- Optionally embed JSON data for client-side use -->
|
| 12 |
+
<script>
|
| 13 |
+
var serverData = {{ data }}; // | tojson
|
| 14 |
+
console.log('Data from server:', serverData);
|
| 15 |
+
</script>
|
| 16 |
+
</body>
|
| 17 |
+
</html>
|
templates/upload_image.html
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>File and Dropdown Selection Form</title>
|
| 7 |
+
</head>
|
| 8 |
+
<body>
|
| 9 |
+
<h1>Upload a File and Select an Option</h1>
|
| 10 |
+
<form action="/output_iqa" method="post" enctype="multipart/form-data">
|
| 11 |
+
<label for="file">Upload file:</label>
|
| 12 |
+
<input type="file" id="file" name="file">
|
| 13 |
+
<br><br>
|
| 14 |
+
|
| 15 |
+
<label for="choice">Criteria Prompt:</label>
|
| 16 |
+
<select name="choice" id="choice">
|
| 17 |
+
<option value="quality">Quality</option>
|
| 18 |
+
<option value="sharpness">Shaprness</option>
|
| 19 |
+
<option value="noisiness">Noisiness</option>
|
| 20 |
+
</select>
|
| 21 |
+
<br><br>
|
| 22 |
+
<button type="submit">Submit</button>
|
| 23 |
+
</form>
|
| 24 |
+
</body>
|
| 25 |
+
</html>
|