浏览代码

fix copy/paste errors in templates

also:
* sort the globs
* add a vid
master
Nimrod Kerrett 2 年前
父节点
当前提交
db94409db8
共有 5 个文件被更改,包括 9 次插入9 次删除
  1. 3
    3
      app.py
  2. 二进制
      static/media/bg-video/thunderstorm.mp4
  3. 2
    2
      templates/chat.html
  4. 2
    2
      templates/example.html
  5. 2
    2
      templates/prompt.txt

+ 3
- 3
app.py 查看文件

258
 @application.get("/enum/<topic>")
258
 @application.get("/enum/<topic>")
259
 def choices(topic):
259
 def choices(topic):
260
     if topic in ["img", "bg", "bg-video", "audio"]:
260
     if topic in ["img", "bg", "bg-video", "audio"]:
261
-        choices = glob("static/media/{}/*.*".format(topic))
261
+        choices = sorted(glob("static/media/{}/*.*".format(topic)))
262
         titles = [os.path.basename(c) for c in choices]
262
         titles = [os.path.basename(c) for c in choices]
263
         try:
263
         try:
264
             descdir = json.load(open("static/media/{}.json".format(topic)))
264
             descdir = json.load(open("static/media/{}.json".format(topic)))
305
         return render_template("save.html",
305
         return render_template("save.html",
306
                 suggestion=time.strftime(
306
                 suggestion=time.strftime(
307
                   "moment-%Y-%m-%d-%H.%M.%S"),
307
                   "moment-%Y-%m-%d-%H.%M.%S"),
308
-                files = [os.path.basename(path).rsplit(".",1)[0] for path in glob("archive/*.json")])
308
+                files = [os.path.basename(path).rsplit(".",1)[0] for path in sorted(glob("archive/*.json"))])
309
 
309
 
310
 @application.route("/load", methods=['GET', 'POST'])
310
 @application.route("/load", methods=['GET', 'POST'])
311
 def load():
311
 def load():
320
         return redirect(url_for("home")+"#/oldest")
320
         return redirect(url_for("home")+"#/oldest")
321
     else:
321
     else:
322
         return render_template("load.html",
322
         return render_template("load.html",
323
-                files = [os.path.basename(path).rsplit(".",1)[0] for path in glob("archive/*.json")])
323
+                files = [os.path.basename(path).rsplit(".",1)[0] for path in sorted(glob("archive/*.json"))])
324
 
324
 
325
 @application.get("/embed-editor")
325
 @application.get("/embed-editor")
326
 def embed_editor():
326
 def embed_editor():

二进制
static/media/bg-video/thunderstorm.mp4 查看文件


+ 2
- 2
templates/chat.html 查看文件

68
                                             <div class="scrollable">
68
                                             <div class="scrollable">
69
                                                 {% if moment.embed %}
69
                                                 {% if moment.embed %}
70
                                                     {% if moment.embed.type == "youtube" %}
70
                                                     {% if moment.embed.type == "youtube" %}
71
-                                                        <div class="iframe-container-{{embed.proportions}}">
71
+                                                        <div class="iframe-container-{{moment.embed.proportions}}">
72
                                                           <iframe src="https://www.youtube.com/embed/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
72
                                                           <iframe src="https://www.youtube.com/embed/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
73
 							</div>
73
 							</div>
74
                                                     {% elif moment.embed.type == "vimeo" %}
74
                                                     {% elif moment.embed.type == "vimeo" %}
75
-                                                        <div class="iframe-container-{{embed.proportions}}">
75
+                                                        <div class="iframe-container-{{moment.embed.proportions}}">
76
                                                           <iframe src="https://player.vimeo.com/video/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
76
                                                           <iframe src="https://player.vimeo.com/video/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
77
 							</div>
77
 							</div>
78
                                                     {% endif %}
78
                                                     {% endif %}

+ 2
- 2
templates/example.html 查看文件

65
                                             <div class="scrollable">
65
                                             <div class="scrollable">
66
                                                 {% if moment.embed %}
66
                                                 {% if moment.embed %}
67
                                                     {% if moment.embed.type == "youtube" %}
67
                                                     {% if moment.embed.type == "youtube" %}
68
-                                                        <div class="iframe-container-{{embed.proportions}}">
68
+                                                        <div class="iframe-container-{{moment.embed.proportions}}">
69
                                                           <iframe src="https://www.youtube.com/embed/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
69
                                                           <iframe src="https://www.youtube.com/embed/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
70
 							</div>
70
 							</div>
71
                                                     {% elif moment.embed.type == "vimeo" %}
71
                                                     {% elif moment.embed.type == "vimeo" %}
72
-                                                        <div class="iframe-container-{{embed.proportions}}">
72
+                                                        <div class="iframe-container-{{moment.embed.proportions}}">
73
                                                           <iframe src="https://player.vimeo.com/video/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
73
                                                           <iframe src="https://player.vimeo.com/video/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
74
 							</div>
74
 							</div>
75
                                                     {% endif %}
75
                                                     {% endif %}

+ 2
- 2
templates/prompt.txt 查看文件

15
 {{example}}
15
 {{example}}
16
 ```
16
 ```
17
 
17
 
18
-Assistant should try to pick bg_video and [optionally] soundtrack or video_content that fit the conversation topic and is beneficial to the user emotionally. These should not stay the same for more than one or two replies to keep the user interested.
18
+Assistant should try to pick bg_video and [optionally] soundtrack or video_content that fit the conversation topic and is beneficial to the user emotionally. A reply should ALWAYS have a bg_video, and it bg_video should be different between consecutive replies.
19
 
19
 
20
-Unlike bg_video, any *video_content* value can only be used ONCE in a session. If assistant runs out of options (or doesn't find anything appropriate for the situation), setting the use_video_content to false is the best option
20
+Unlike bg_video, any *video_content* value can only be used ONCE in a session. If assistant runs out of options (or doesn't find anything appropriate for the situation), setting the use_video_content to false is a good choice.
21
 
21
 
22
 Assistant can also incorporate images inside the markdown field in the format ![alt](src) but src should be a valid option according to the following enum (the corresponding enum_titles value can be used as alt)
22
 Assistant can also incorporate images inside the markdown field in the format ![alt](src) but src should be a valid option according to the following enum (the corresponding enum_titles value can be used as alt)
23
 
23
 

正在加载...
取消
保存