Remove some deprecated and currently not working "Hgging Face" bots (#973)

This commit is contained in:
Peter Dave Hello
2025-02-14 01:14:17 +08:00
committed by GitHub
parent 8151906954
commit 85641c23ca
13 changed files with 1 additions and 212 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

-11
View File
@@ -1,11 +0,0 @@
import HuggingChatBot from "@/bots/huggingface/HuggingChatBot";
export default class CodeLlamaHCBot extends HuggingChatBot {
static _className = "CodeLlamaHCBot"; // Class name of the bot
static _logoFilename = "codellama-hc-logo.png"; // Place it in public/bots/
static _model = "codellama/CodeLlama-34b-Instruct-hf";
constructor() {
super();
}
}
-77
View File
@@ -1,77 +0,0 @@
import GradioBot from "@/bots/huggingface/GradioBot";
import AsyncLock from "async-lock";
import axios from "axios";
import store from "@/store";
export default class Falcon180bBot extends GradioBot {
static _brandId = "falcon"; // Brand id of the bot, should be unique. Used in i18n.
static _className = "Falcon180bBot"; // Class name of the bot
static _logoFilename = "falcon-180b-logo.jpeg"; // Place it in public/bots/
static _loginUrl = "https://tiiuae-falcon-180b-demo.hf.space/"; // Any Gradio URL
static _settingsComponent = "Falcon180bBotSettings"; // Vue component filename for settings
static _model = "falcon-180b";
static _lock = new AsyncLock(); // Send requests in queue to save LMSYS
static _fnIndexes = [3]; // Indexes of the APIs to call in order. Sniffer it by devtools.
static _predictUrl = Falcon180bBot._loginUrl + "run/predict";
constructor() {
super();
}
sendPredict(fn_index, session_hash, payload) {
return axios.post(Falcon180bBot._predictUrl, {
fn_index,
data: [],
event_data: null,
session_hash: session_hash,
...payload,
});
}
async _sendPrompt(prompt, onUpdateResponse, callbackParam) {
try {
const session_hash = await this.getChatContext();
await axios.all([
this.sendPredict(4, session_hash),
this.sendPredict(1, session_hash, {
data: [prompt],
}),
]);
await this.sendPredict(2, session_hash, { data: [null, null] });
await super._sendPrompt(prompt, onUpdateResponse, callbackParam);
await this.sendPredict(5, session_hash);
} catch (error) {
throw Error(error);
}
}
/* eslint-disable no-unused-vars */
makeData(fn_index, prompt) {
let r = null;
if (fn_index === this.constructor._fnIndexes[0]) {
r = [
null,
null,
"",
store.state.falcon.temperature,
store.state.falcon.maxNewTokens,
store.state.falcon.topP,
store.state.falcon.repetitionPenalty,
];
}
return r;
}
parseData(fn_index, data) {
let r = undefined;
if (fn_index === this.constructor._fnIndexes[0]) {
r = data[0][data[0].length - 1][1];
}
return r;
}
parseError(errorMsg) {
return errorMsg;
}
}
-11
View File
@@ -1,11 +0,0 @@
import HuggingChatBot from "@/bots/huggingface/HuggingChatBot";
export default class FalconHC180bBot extends HuggingChatBot {
static _className = "FalconHC180bBot"; // Class name of the bot
static _logoFilename = "falcon-180b-hc-logo.png"; // Place it in public/bots/
static _model = "tiiuae/falcon-180B-chat";
constructor() {
super();
}
}
-11
View File
@@ -1,11 +0,0 @@
import HuggingChatBot from "@/bots/huggingface/HuggingChatBot";
export default class Llama2HC70bBot extends HuggingChatBot {
static _className = "Llama2HC70bBot"; // Class name of the bot
static _logoFilename = "llama-huggingchat-logo.png"; // Place it in public/bots/
static _model = "meta-llama/Llama-2-70b-chat-hf";
constructor() {
super();
}
}
-16
View File
@@ -1,16 +0,0 @@
import HuggingChatBot from "@/bots/huggingface/HuggingChatBot";
export default class Zephyr7bBot extends HuggingChatBot {
static _className = "Zephyr7bBot"; // Class name of the bot
static _logoFilename = "zephyr-7b-logo.png"; // Place it in public/bots/
static _loginUrl = "https://huggingfaceh4-zephyr-chat.hf.space/";
static _model = "HuggingFaceH4/zephyr-7b-beta";
constructor() {
super();
}
getFullname() {
return "Zephyr-7B-β";
}
}
+1 -21
View File
@@ -45,12 +45,7 @@ import PiBot from "./PiBot";
import Qihoo360AIBrainBot from "./Qihoo360AIBrainBot";
import CharacterAIBot from "./CharacterAIBot";
import ClaudeAIBot from "./ClaudeAIBot";
import Llama2HC70bBot from "./huggingface/Llama2HC70bBot";
import Falcon180bBot from "./huggingface/Falcon180bBot";
import FalconHC180bBot from "./huggingface/FalconHC180bBot";
import CodeLlamaHCBot from "./huggingface/CodeLlamaHCBot";
import WenxinQianfan4Bot from "./baidu/WenxinQianfan4Bot";
import Zephyr7bBot from "./huggingface/Zephyr7bBot";
import GeminiAdvBot from "./google/GeminiAdvBot";
import ChatGLM4Bot from "./zhipu/ChatGLM4Bot";
import KimiBot from "./moonshot/KimiBot";
@@ -76,7 +71,6 @@ const all = [
ClaudeAPIHaikuBot.getInstance(),
ClaudeAPI20Bot.getInstance(),
ClaudeAPI21Bot.getInstance(),
CodeLlamaHCBot.getInstance(),
CohereAPICommandBot.getInstance(),
CohereAPICommandLightBot.getInstance(),
CohereAPICommandRBot.getInstance(),
@@ -85,8 +79,6 @@ const all = [
WenxinQianfanBot.getInstance(),
WenxinQianfanTurboBot.getInstance(),
WenxinQianfan4Bot.getInstance(),
Falcon180bBot.getInstance(),
FalconHC180bBot.getInstance(),
BardBot.getInstance(),
GeminiAdvBot.getInstance(),
GeminiAPIBot.getInstance(),
@@ -110,7 +102,6 @@ const all = [
Llama370bGroqAPIBot.getInstance(),
Mixtral8x7bGroqAPIBot.getInstance(),
KimiBot.getInstance(),
Llama2HC70bBot.getInstance(),
MistralBot.getInstance(),
MOSSBot.getInstance(),
HuggingChatBot.getInstance(),
@@ -120,13 +111,12 @@ const all = [
QianWenBot.getInstance(),
SkyWorkBot.getInstance(),
SparkBot.getInstance(),
Zephyr7bBot.getInstance(),
YouChatBot.getInstance(),
GrokBetaAPIBot.getInstance(),
Grok2APIBot.getInstance(),
];
const disabled = ["HuggingChatBot", "Falcon180bBot"];
const disabled = ["HuggingChatBot"];
if (process.env.NODE_ENV !== "production") {
all.push(DevBot.getInstance());
@@ -154,8 +144,6 @@ export const botTags = {
bots.getBotByClassName("ChatGLM4Bot"),
bots.getBotByClassName("ChatGPT35Bot"),
bots.getBotByClassName("HuggingChatBot"),
bots.getBotByClassName("Llama2HC70bBot"),
bots.getBotByClassName("CodeLlamaHCBot"),
bots.getBotByClassName("MistralBot"),
bots.getBotByClassName("MOSSBot"),
bots.getBotByClassName("Qihoo360AIBrainBot"),
@@ -169,9 +157,6 @@ export const botTags = {
bots.getBotByClassName("PerplexityBot"),
bots.getBotByClassName("PhindBot"),
bots.getBotByClassName("PiBot"),
bots.getBotByClassName("Falcon180bBot"),
bots.getBotByClassName("FalconHC180bBot"),
bots.getBotByClassName("Zephyr7bBot"),
bots.getBotByClassName("KimiBot"),
],
paid: [
@@ -181,12 +166,7 @@ export const botTags = {
],
openSource: [
bots.getBotByClassName("HuggingChatBot"),
bots.getBotByClassName("Llama2HC70bBot"),
bots.getBotByClassName("MOSSBot"),
bots.getBotByClassName("Falcon180bBot"),
bots.getBotByClassName("CodeLlamaHCBot"),
bots.getBotByClassName("FalconHC180bBot"),
bots.getBotByClassName("Zephyr7bBot"),
],
api: [
bots.getBotByClassName("GeminiAPIBot"),
@@ -1,63 +0,0 @@
<template>
<CommonBotSettings
:settings="settings"
:brand-id="brandId"
mutation-type="setFalcon"
></CommonBotSettings>
</template>
<script>
import Bot from "@/bots/huggingface/Falcon180bBot";
import CommonBotSettings from "@/components/BotSettings/CommonBotSettings.vue";
import { Type } from "./settings.const";
const settings = [
{
type: Type.Slider,
name: "temperature",
title: "falcon.temperature",
description: "falcon.temperaturePrompt",
min: 0,
max: 1,
step: 0.05,
},
{
type: Type.Slider,
name: "maxNewTokens",
title: "falcon.maxNewTokens",
description: "falcon.maxNewTokensPrompt",
min: 0,
max: 8192,
step: 64,
},
{
type: Type.Slider,
name: "topP",
title: "falcon.topP",
description: "falcon.topPPrompt",
min: 0,
max: 1,
step: 0.05,
},
{
type: Type.Slider,
name: "repetitionPenalty",
title: "falcon.repetitionPenalty",
description: "falcon.repetitionPenaltyPrompt",
min: 1,
max: 2,
step: 0.05,
},
];
export default {
components: {
CommonBotSettings,
},
data() {
return {
settings: settings,
brandId: Bot._brandId,
};
},
};
</script>
-2
View File
@@ -110,7 +110,6 @@ import MistralBotSettings from "@/components/BotSettings/MistralBotSettings.vue"
import MOSSBotSettings from "@/components/BotSettings/MOSSBotSettings.vue";
import WenxinQianfanBotSettings from "@/components/BotSettings/WenxinQianfanBotSettings.vue";
import GradioAppBotSettings from "@/components/BotSettings/GradioAppBotSettings.vue";
import Falcon180bBotSettings from "@/components/BotSettings/Falcon180bBotSettings.vue";
import LMSYSBotSettings from "@/components/BotSettings/LMSYSBotSettings.vue";
import HuggingChatBotSettings from "@/components/BotSettings/HuggingChatBotSettings.vue";
import QianWenBotSettings from "@/components/BotSettings/QianWenBotSettings.vue";
@@ -153,7 +152,6 @@ const botSettings = [
{ brand: "claudeAi", component: ClaudeAIBotSettings },
{ brand: "claudeApi", component: ClaudeAPIBotSettings },
{ brand: "cohereApi", component: CohereAPIBotSettings },
{ brand: "falcon", component: Falcon180bBotSettings },
{ brand: "geminiApi", component: GeminiAPIBotSettings },
{ brand: "gradio", component: GradioAppBotSettings },
{ brand: "groqApi", component: GroqAPIBotSettings },