Spaces:
Running
Running
Adds options to select the new models added
Browse files- client/html/index.html +7 -2
- server/backend.py +6 -2
- server/config.py +2 -0
client/html/index.html
CHANGED
@@ -71,7 +71,10 @@
|
|
71 |
<div class="buttons">
|
72 |
<div class="field">
|
73 |
<select class="dropdown" name="model" id="model">
|
74 |
-
<option value="gpt-3.5-turbo"
|
|
|
|
|
|
|
75 |
<option value="gpt-4" disabled>GPT-4 (maintenance)</option>
|
76 |
</select>
|
77 |
</div>
|
@@ -97,7 +100,9 @@
|
|
97 |
</div>
|
98 |
|
99 |
<!-- scripts -->
|
100 |
-
<script>
|
|
|
|
|
101 |
<script src="/assets/js/icons.js"></script>
|
102 |
<script src="/assets/js/chat.js" defer></script>
|
103 |
<script src="https://cdn.jsdelivr.net/npm/markdown-it@latest/dist/markdown-it.min.js"></script>
|
|
|
71 |
<div class="buttons">
|
72 |
<div class="field">
|
73 |
<select class="dropdown" name="model" id="model">
|
74 |
+
<option value="gpt-3.5-turbo">GPT-3.5</option>
|
75 |
+
<option value="gpt-3.5-turbo-0613">GPT-3.5-0613</option>
|
76 |
+
<option value="gpt-3.5-turbo-16k">GPT-3.5-TURBO-16k</option>
|
77 |
+
<option value="gpt-3.5-turbo-16k-0613" selected>GPT-3.5-TURBO-16k-0613</option>
|
78 |
<option value="gpt-4" disabled>GPT-4 (maintenance)</option>
|
79 |
</select>
|
80 |
</div>
|
|
|
100 |
</div>
|
101 |
|
102 |
<!-- scripts -->
|
103 |
+
<script>
|
104 |
+
window.conversation_id = "{{ chat_id }}";
|
105 |
+
</script>
|
106 |
<script src="/assets/js/icons.js"></script>
|
107 |
<script src="/assets/js/chat.js" defer></script>
|
108 |
<script src="https://cdn.jsdelivr.net/npm/markdown-it@latest/dist/markdown-it.min.js"></script>
|
server/backend.py
CHANGED
@@ -49,8 +49,12 @@ class Backend_Api:
|
|
49 |
messages = build_messages(jailbreak)
|
50 |
|
51 |
# Generate response
|
52 |
-
response = ChatCompletion.create(
|
53 |
-
|
|
|
|
|
|
|
|
|
54 |
|
55 |
return self.app.response_class(generate_stream(response, jailbreak), mimetype='text/event-stream')
|
56 |
|
|
|
49 |
messages = build_messages(jailbreak)
|
50 |
|
51 |
# Generate response
|
52 |
+
response = ChatCompletion.create(
|
53 |
+
model=model,
|
54 |
+
stream=True,
|
55 |
+
chatId=conversation_id,
|
56 |
+
messages=messages
|
57 |
+
)
|
58 |
|
59 |
return self.app.response_class(generate_stream(response, jailbreak), mimetype='text/event-stream')
|
60 |
|
server/config.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
models = {
|
2 |
'gpt-3.5-turbo',
|
|
|
|
|
3 |
'gpt-4',
|
4 |
}
|
5 |
|
|
|
1 |
models = {
|
2 |
'gpt-3.5-turbo',
|
3 |
+
'gpt-3.5-turbo-16k-0613',
|
4 |
+
'gpt-3.5-turbo-16k',
|
5 |
'gpt-4',
|
6 |
}
|
7 |
|