File size: 3,482 Bytes
7373476
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Home - NLP Model Trainer</title>
    <style>

        body {

            font-family: Arial, sans-serif;

            background-color: #f4f7fa;

            color: #333;

            margin: 0;

            padding: 0;

            display: flex;

            justify-content: center;

            align-items: center;

            min-height: 100vh;

        }

        .container {

            width: 90%;

            max-width: 800px;

            background-color: #ffffff;

            padding: 30px;

            border-radius: 10px;

            box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);

            text-align: center;

        }

        h1, h2 {

            color: #4a90e2;

            margin-bottom: 20px;

        }

        ul {

            list-style-type: none;

            padding: 0;

        }

        li {

            display: flex;

            justify-content: space-between;

            align-items: center;

            padding: 10px 0;

            border-bottom: 1px solid #e0e0e0;

        }

        li:last-child {

            border-bottom: none;

        }

        a {

            color: #4a90e2;

            text-decoration: none;

            font-weight: bold;

        }

        a:hover {

            text-decoration: underline;

        }

        form {

            margin-top: 30px;

            display: flex;

            flex-direction: column;

            align-items: center;

        }

        label {

            margin: 10px 0 5px;

            font-size: 14px;

            color: #555;

        }

        input[type="text"],

        input[type="file"] {

            width: 100%;

            max-width: 400px;

            padding: 8px;

            margin-bottom: 15px;

            border: 1px solid #ccc;

            border-radius: 5px;

            font-size: 14px;

        }

        button[type="submit"] {

            padding: 10px 20px;

            font-size: 16px;

            color: white;

            background-color: #4a90e2;

            border: none;

            border-radius: 5px;

            cursor: pointer;

            transition: background-color 0.3s;

        }

        button[type="submit"]:hover {

            background-color: #357ab8;

        }

        .redirect-btn {

            margin-top: 20px;

            font-size: 16px;

            color: #4a90e2;

            background: none;

            border: none;

            cursor: pointer;

        }

    </style>
</head>

<body>
    <div class="container">
        <h1>Available Models</h1>
        <ul>
            {% for model in models %}
            <li>
                <a href="{{ url_for('chat', model_name=model) }}">{{ model }}</a>
                <a href="{{ url_for('download_model', model_name=model) }}">Download</a>
            </li>
            {% endfor %}
        </ul>

        <h2>Upload New Model</h2>
        <form action="{{ url_for('upload_file') }}" method="post" enctype="multipart/form-data">
            <label>Model Name:</label>
            <input type="text" name="model_name" required>
            <label>Q&A CSV File:</label>
            <input type="file" name="file" accept=".csv" required>
            <button type="submit">Train Model</button>
        </form>
    </div>
</body>
</html>