Repository: ai-shifu/ChatALL (language: javascript)

Issue:
Add Zephyr 7b
### Is your feature request related to a problem? / 你想要的功能和什么问题相关？

https://huggingface.co/spaces/HuggingFaceH4/zephyr-chat

### Describe the solution you'd like. / 你想要的解决方案是什么？

https://huggingface.co/spaces/HuggingFaceH4/zephyr-chat

### Describe alternatives you've considered. / 你考虑过的其他方案是什么？

_No response_

### Additional context / 其他信息

_No response_


Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index 1671b332e..79692c8ee 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,7 @@ Typical users of ChatALL are:
 | [WizardLM 13B & 70B](https://github.com/nlpxucan/WizardLM)                     | Yes         | No API      |                                             |
 | [Falcon 180B](https://huggingface.co/tiiuae/falcon-180B-chat)                  | Yes         | No API      |                                             |
 | [Phind](https://www.phind.com/)                                                | Yes         | No API      |                                             |
+| [Zephyr](https://huggingface.co/spaces/HuggingFaceH4/zephyr-chat)              | Yes         | No API      |                                             |
 
 More is coming. Upvote your favorite bots in [these issues](https://github.com/sunner/ChatALL/labels/more%20LLMs).
 
diff --git a/public/bots/zephyr-7b-logo.png b/public/bots/zephyr-7b-logo.png
new file mode 100644
index 000000000..19c6e6d28
Binary files /dev/null and b/public/bots/zephyr-7b-logo.png differ
diff --git a/src/bots/huggingface/HuggingChatBot.js b/src/bots/huggingface/HuggingChatBot.js
index 503b70851..cdd281551 100644
--- a/src/bots/huggingface/HuggingChatBot.js
+++ b/src/bots/huggingface/HuggingChatBot.js
@@ -50,7 +50,7 @@ export default class HuggingChatBot extends Bot {
 
         try {
           const response = await fetch(
-            `https://huggingface.co/chat/conversation/${conversationId}`,
+            `${this.constructor._loginUrl}conversation/${conversationId}`,
             {
               method: "POST",
               headers: {
@@ -125,7 +125,7 @@ export default class HuggingChatBot extends Bot {
   async createChatContext() {
     let conversationId = "";
     await axios
-      .post("https://huggingface.co/chat/conversation", {
+      .post(`${this.constructor._loginUrl}conversation`, {
         model: this.constructor._model,
       })
       .then(({ data: resp }) => {
diff --git a/src/bots/huggingface/Zephyr7bBot.js b/src/bots/huggingface/Zephyr7bBot.js
new file mode 100644
index 000000000..992d8c93d
--- /dev/null
+++ b/src/bots/huggingface/Zephyr7bBot.js
@@ -0,0 +1,16 @@
+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-β";
+  }
+}
diff --git a/src/bots/index.js b/src/bots/index.js
index 0d3c179f0..2e6213fa1 100644
--- a/src/bots/index.js
+++ b/src/bots/index.js
@@ -52,6 +52,7 @@ import Wizardlm70bBot from "./lmsys/Wizardlm70bBot";
 import FalconHC180bBot from "./huggingface/FalconHC180bBot";
 import CodeLlamaHCBot from "./huggingface/CodeLlamaHCBot";
 import WenxinQianfan4Bot from "./baidu/WenxinQianfan4Bot";
+import Zephyr7bBot from "./huggingface/Zephyr7bBot";
 
 const all = [
   Qihoo360AIBrainBot.getInstance(),
@@ -105,6 +106,7 @@ const all = [
   VicunaBot.getInstance(),
   Wizardlm13bBot.getInstance(),
   Wizardlm70bBot.getInstance(),
+  Zephyr7bBot.getInstance(),
   YouChatBot.getInstance(),
 ];
 
@@ -166,6 +168,7 @@ export const botTags = {
     bots.getBotByClassName("Wizardlm13bBot"),
     bots.getBotByClassName("Wizardlm70bBot"),
     bots.getBotByClassName("FalconHC180bBot"),
+    bots.getBotByClassName("Zephyr7bBot"),
   ],
   paid: [
     bots.getBotByClassName("ChatGPT4Bot"),
@@ -195,6 +198,7 @@ export const botTags = {
     bots.getBotByClassName("Wizardlm13bBot"),
     bots.getBotByClassName("Wizardlm70bBot"),
     bots.getBotByClassName("FalconHC180bBot"),
+    bots.getBotByClassName("Zephyr7bBot"),
   ],
   api: [
     bots.getBotByClassName("AzureOpenAIAPIBot"),
diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json
index 3f8744cb5..d1651e079 100644
--- a/src/i18n/locales/en.json
+++ b/src/i18n/locales/en.json
@@ -145,7 +145,8 @@
     "codellamaCodeLlama-34b-Instruct-hf": "Code Llama",
     "OpenAssistantoasst-sft-6-llama-30b-xor": "oasst-sft-6-llama-30b",
     "meta-llamaLlama-2-70b-chat-hf": "llama-2-70b",
-    "tiiuaefalcon-180B-chat": "falcon-180b"
+    "tiiuaefalcon-180B-chat": "falcon-180b",
+    "HuggingFaceH4zephyr-7b-beta": "zephyr-7b"
   },
   "gradio": {
     "fnIndex": "fn_index",
diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json
index ec4459468..de0ae0251 100644
--- a/src/i18n/locales/zh.json
+++ b/src/i18n/locales/zh.json
@@ -145,7 +145,8 @@
     "codellamaCodeLlama-34b-Instruct-hf": "Code Llama",
     "OpenAssistantoasst-sft-6-llama-30b-xor": "oasst-sft-6-llama-30b",
     "meta-llamaLlama-2-70b-chat-hf": "llama-2-70b",
-    "tiiuaefalcon-180B-chat": "falcon-180b"
+    "tiiuaefalcon-180B-chat": "falcon-180b",
+    "HuggingFaceH4zephyr-7b-beta": "zephyr-7b"
   },
   "gradio": {
     "fnIndex": "fn_index",


Test patch: