forked from LAION-AI/Open-Assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.ts
45 lines (44 loc) · 1.31 KB
/
model.ts
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
import {
SlashCommandBuilder,
ActionRowBuilder,
StringSelectMenuBuilder,
StringSelectMenuOptionBuilder,
} from "discord.js";
import { createInferenceClient } from "../modules/inference/client.js";
import redis from "../modules/redis.js";
export default {
data: {
customId: "model",
description: "Switch to another model.",
},
async execute(interaction, client, userId) {
if (interaction.user.id != userId)
return interaction.reply({
content: "You don't have permission to do this.",
ephemeral: true,
});
// model selector
let row = new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder()
.setCustomId("modelselect")
.setPlaceholder("Select a model")
.setMinValues(1)
.setMaxValues(1)
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel("OA_SFT_Llama_30B")
.setDescription("Llama (default)")
.setValue("OA_SFT_Llama_30B"),
new StringSelectMenuOptionBuilder()
.setLabel("oasst-sft-4-pythia-12b")
.setDescription("Pythia")
.setValue("OpenAssistant/oasst-sft-4-pythia-12b-epoch-3.5")
)
);
await interaction.reply({
content: "Select a model.",
components: [row],
ephemeral: true,
});
},
};