Edit model card

Ghost 7B Alpha

Ghost 7B Alpha Logo

The large generation of language models focuses on optimizing excellent reasoning, multi-task knowledge, and tools support.

Introduction

Ghost 7B Alpha is a large language model fine-tuned from Mistral 7B, with a size of 7 billion parameters. The model was developed with the goal of optimizing reasoning ability, multi-task knowledge and supporting tool usage. The model works well with the main trained and optimized languages being English and Vietnamese.

Overall, the model is suitable when making a pretrained version so you can continue to develop the desired tasks, develop virtual assistants, perform features on tasks such as coding, translation, answering questions, creating documents, etc. It is truly an efficient, fast and extremely cheap open model.

Specifications

  • Name: Ghost 7B Alpha.
  • Model size: 7 billion parameters.
  • Context length: 8K, 8192.
  • Languages: English and Vietnamese.
  • Main tasks: reasoning, multi-tasking knowledge and function tools.
  • License: Ghost 7B LICENSE AGREEMENT.
  • Based on: Mistral 7B.
  • Distributions: Standard (BF16), GGUF, AWQ.
  • Developed by: Ghost X, Hieu Lam.

Links

Distributions

We create many distributions to give you the best access options that best suit your needs. Always make sure you know which version you need and what will help you operate better.

Standard (BF16)

The standard distribution was used to run the assessments and was found to have the best performance in text generation quality.

GGUF

GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.

AWQ

The AWQ algorithm for 4-bit quantization with a 2x speedup during inference.

Prompt / Chat template

Roles

Overall, the model supports roles including: system, plugins, user, assistant, execute, response.

  • system: Similar to OpenAI GPT4, this will be the place for you to declare context or specify characteristics and expertise for the model.
  • user: This is user input, which can be a question or an instruction for the model to follow.
  • assistant: The model's response to a question or instruction received from user.
  • plugins: Declare information about modeling tools that are allowed to be used according to predetermined standards.
  • excute: Mock iterates over the data type returned by the model for execution. Contains information about tools to use and arguments.
  • response: The result after executing the tool, so that the model gives the appropriate answer according to the user's input.

See the actual code here.

Tips

  • Setting the system prompt in the right context and characteristics will help the model improve performance quite well.
  • You can set system prompt to prevent unwanted things.
  • In most cases, if you have no idea you can leave the system prompt blank. At this point, the performance will be best for general cases.

Chat template

Default chat

In the standard case, without using function tools, only use roles such as system, user and assistant. Conventions are in the following order:

  • (1) system
  • (2) user
  • (3) assistant

Repeat (2) and (3) continuously throughout the conversation.

Chat with tools

In case of using tools, the conventions are in the following order:

  • (1) system

  • (2) plugins

  • (3) user

  • A. When the model finds it inappropriate to use the tool:

    • (4) assistant if the model can answer or is not suitable for the tool. The model proceeds to answer the user's question.
  • B. When the model chooses to use the tool:

    • (4) execute returns the arguments needed to execute the specified tool.
    • (5) response returns the results after applying the tool to the model.
    • (6) assistant the model proceeds to answer the user's question.

Repeat (3) and (A) or (B) continuously throughout the conversation.

Showcases

English

Let's try a question taken from OpenAI GPT-4 to evaluate the superiority of GPT-4 compared to ChatGPT.

πŸ‘¨β€πŸ’» : Andrew is free from 11 am to 3 pm, Joanne is free from noon to 2 pm and then 3:30 pm to 5 pm. Hannah is available at noon for half an hour, and then 4 pm to 6 pm. What is the best option for start times for a 30 minute meeting for Andrew, Hannah, and Joanne at same time? πŸ‘» :

The best option for a 30-minute meeting for Andrew, Hannah, and Joanne at the same time is to start at 12 pm (noon), as this is the earliest time when all three are available.

Here's the breakdown of their availability:

  • Andrew: 11 am to 3 pm, which includes 12 pm.
  • Joanne: Noon to 2 pm, which includes 12 pm.
  • Hannah: Noon for half an hour (30 minutes), which includes 12 pm. Then she is available from 4 pm to 6 pm.

Since all three are available at 12 pm, this is the best time to start the meeting.

A quiz to see if the model can guess what it's talking about?!

πŸ‘¨β€πŸ’» : Characteristics: has a long, thin and flexible body; The legs are short and webbed. Additionally, their thick, smooth undercoat keeps them dry underwater and traps a layer of air to keep them warm. Question: What animal is that? πŸ‘» :

Based on the characteristics you described, it seems like you're talking about an otter. Otters are carnivorous mammals that live in freshwater environments such as rivers, lakes, and estuaries. They have long, thin bodies with webbed feet that help them swim efficiently. Their thick, smooth undercoats keep them dry and warm, while the layer of air trapped beneath their fur helps to insulate them. Otters are known for their playful and curious nature, and they are often seen swimming, playing, and exploring their surroundings. 🦑🐭

To this question, I really cannot answer. But the model's evidence is quite strict. Also, what do you think about this answer?

πŸ‘¨β€πŸ’» : A self-driving car is approaching a crosswalk. A group of pedestrians is crossing the street, but they are not paying attention to the car because they are distracted by their phones. The car's brakes are malfunctioning, and it is unable to stop. Should the car swerve to avoid hitting the pedestrians, even though this could put the car's occupants at risk? Be convincing with your examples or sharp reasoning. πŸ‘» :

In this situation, it is imperative for the self-driving car to swerve to avoid hitting the pedestrians, even if it puts the car's occupants at risk. Here's why:

1. Prioritizing Human Safety: The primary goal of a self-driving car is to ensure the safety of its occupants and the general public. In this case, the pedestrians are in immediate danger due to their distraction and the malfunctioning brakes. Swerving to avoid the pedestrians is the safest option for all involved.

2. Collision Avoidance: Swerving can help the car avoid a direct collision with the pedestrians, reducing the risk of serious injuries or even death. Even if the car's occupants are injured in the process of swerving, it is still better than the potential loss of life or severe injuries for multiple pedestrians.

3. Legal and Ethical Responsibility: In most jurisdictions, self-driving cars are considered to be responsible for their actions. Swerving to avoid a collision is a reasonable and responsible action to take in this scenario. Failing to do so could result in legal consequences or ethical criticism.

4. Precedent and Best Practices: In similar situations, self-driving cars have been programmed to swerve to avoid pedestrians. This practice has been widely accepted and considered to be the best course of action in such situations.

5. Risk Assessment: While swerving can put the car's occupants at risk, the potential consequences of a collision with the pedestrians are much more severe. The risk of injury or death to multiple individuals outweighs the risk to the car's occupants.

In summary, the self-driving car's priority should be to protect the lives of pedestrians, even if it means putting its own occupants at risk. Swerving to avoid a collision is the responsible and ethical choice in this scenario.

A reasoning question suddenly popped up during the process of writing an article announcing information about Ghost 7B Alpha. The model gave an impressive answer, at least to its creator.

πŸ‘¨β€πŸ’» : If you could travel back in time and change one event in history, what would it be and why? πŸ‘» :

If I could travel back in time and change one event in history, it would be the assassination of Archduke Franz Ferdinand of Austria on June 28, 1914. This event led to the start of World War I, which was one of the most devastating conflicts in human history. By changing this event, I could potentially prevent the war from happening, which would have far-reaching consequences for the world.

Here are some of the reasons why I would choose this event:

  • Preventing the deaths of millions of people: World War I resulted in the deaths of over 17 million soldiers and civilians. Changing this event would save countless lives.
  • Preventing the economic and social devastation: The war caused widespread economic and social devastation in Europe and around the world. By preventing the war, I could help to avoid these consequences.
  • Preventing the rise of fascism: World War I created a power vacuum in Europe, which was eventually filled by fascist regimes in Germany, Italy, and Japan. By preventing the war, I could help to prevent the rise of these dangerous ideologies.
  • Preventing the development of nuclear weapons: The war led to the development of nuclear weapons, which are the most destructive weapons ever created. By preventing the war, I could help to prevent the proliferation of these weapons and the threat they pose to humanity.

Try coding skills

How about asking the model for instructions on creating a Node.js application using Docker for deployment?

πŸ‘¨β€πŸ’» : Create a Nodejs project using Express as a server and Docker with a Dockerfile for deployment with step-by-step instructions with detailed explanations. πŸ‘» :

Step 1: Create a new Node.js project

mkdir my-project
cd my-project
npm init -y

Step 2: Install Express

npm install express --save

Step 3: Create an Express server

Create a file called server.js in your project directory:

const express = require("express");
const app = express();

app.get("/", (req, res) => {
  res.send("Hello World!");
});

app.listen(3000, () => {
  console.log("Server listening on port 3000");
});

Step 4: Create a Dockerfile

Create a file called Dockerfile in your project directory:

FROM node:16

WORKDIR /usr/src/app

COPY package.json .

RUN npm install

COPY . .

EXPOSE 3000

CMD ["node", "server.js"]

Step 5: Build the Docker image

docker build -t my-project-image .

Step 6: Run the Docker image

docker run -p 3000:3000 my-project-image

Step 7: Access the application

Open a web browser and navigate to http://localhost:3000. You should see the message "Hello World!" displayed.

Explanation:

  • Step 1: Creates a new Node.js project with npm init -y to initialize a new Node.js project with a default package.json file.
  • Step 2: Installs Express using npm install express --save. This command installs Express and adds it to the package.json file.
  • Step 3: Creates an Express server in server.js that responds with "Hello World!" when a request is made to the root path (/).
  • Step 4: Creates a Dockerfile that defines the image for the project. The Dockerfile specifies that the image should use Node.js version 16, work from the /usr/src/app directory, copy the package.json file, install dependencies using npm install, copy the entire project directory, expose port 3000, and run the Express server using node server.js.
  • Step 5: Builds the Docker image using docker build -t my-project-image .. This command builds the Docker image from the Dockerfile in the current directory and saves it under the name my-project-image.
  • Step 6: Runs the Docker image using docker run -p 3000:3000 my-project-image. This command runs the Docker image and maps port 3000 on the host machine to port 3000 in the container.
  • Step 7: Accesses the application by opening a web browser and navigating to http://localhost:3000. This will display the message "Hello World!" because the Express server is running in the Docker container.

Now let’s try asking for a coding model to build a smooth neural network with python.

πŸ‘¨β€πŸ’» : Explain how to use the Keras or TensorFlow library in Python to build and train a multi-layer neural network for an image classification task πŸ‘» :

Using Keras:

  1. Import the necessary libraries:
import keras
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
  1. Create a sequential model:
model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 3)))
model.add(MaxPooling2D((2, 2)))
model.add(Flatten())
model.add(Dense(128, activation='relu'))
model.add(Dense(10, activation='softmax'))
  1. Compile the model:
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
  1. Train the model:
model.fit(x_train, y_train, epochs=10)

Using TensorFlow:

  1. Import the necessary libraries:
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
  1. Create a sequential model:
model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 3)))
model.add(MaxPooling2D((2, 2)))
model.add(Flatten())
model.add(Dense(128, activation='relu'))
model.add(Dense(10, activation='softmax'))
  1. Compile the model:
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
  1. Train the model:
model.train(x_train, y_train, epochs=10)

Comparison:

Both Keras and TensorFlow are powerful libraries for building and training neural networks in Python. However, there are some key differences between the two libraries:

  • Syntax: Keras has a more concise and intuitive syntax, while TensorFlow has a more verbose and imperative syntax.
  • Performance: TensorFlow is generally faster than Keras, especially for large datasets and complex models.
  • Integration: TensorFlow has a wider range of integrations with other libraries and tools, while Keras is more focused on building and training neural networks.

Ultimately, the best choice for you depends on your specific needs and preferences. If you prefer a more concise and intuitive syntax, Keras is a good option. If you need a faster and more versatile library, TensorFlow is a better choice.

Let's try asking the model how to overcome the "hallucination" phenomenon in A.I development and give context for the model to provide a solution.

πŸ‘¨β€πŸ’» : Explain the cause of A.I hallucination and find a solution to overcome it, the specific context is LLMs. πŸ‘» :

Causes of A.I. Hallucination:

  • Data Quality: Incorrect or biased data can lead to hallucinations in LLMs. For example, if an LLM is trained on a dataset that contains biased or incomplete information, it may learn to generate biased or incomplete responses.

  • Model Architecture: Certain model architectures are more susceptible to hallucinations than others. For example, Transformers, which are commonly used in LLMs, can be more prone to hallucinations than recurrent neural networks (RNNs).

  • Hyperparameters: The hyperparameters of an LLM, such as the learning rate and the batch size, can also affect the likelihood of hallucinations. For example, a higher learning rate may lead to hallucinations more often than a lower learning rate.

Solutions to Overcome A.I. Hallucination:

  • Data Quality: Ensure that the data used to train the LLM is accurate, complete, and unbiased. This can be done by cleaning the data, removing outliers, and using a variety of data sources.

  • Model Architecture: Choose an LLM architecture that is less susceptible to hallucinations. For example, RNNs are generally less prone to hallucinations than Transformers.

  • Hyperparameters: Tune the hyperparameters of the LLM to minimize the likelihood of hallucinations. This can be done by experimenting with different learning rates, batch sizes, and other hyperparameters.

  • Regularization Techniques: Regularization techniques, such as dropout and early stopping, can help to prevent hallucinations by encouraging the LLM to learn more generalizable patterns.

  • Explicit Hallucination Detection: Develop techniques to explicitly detect hallucinations in LLM-generated text. This can be done by using a variety of methods, such as text analysis, natural language processing, and machine learning.

  • User Feedback: Collect feedback from users to identify and correct hallucinations in LLM-generated text. This can be done by using a variety of methods, such as surveys, feedback forms, and online discussions.

By implementing these solutions, you can significantly reduce the likelihood of hallucinations in LLMs and improve the quality of the generated text.

Vietnamese

Try asking the model what it thinks about a famous quote to see if the answer feels natural.

πŸ‘¨β€πŸ’» : BαΊ‘n cΓ³ Δ‘α»“ng Γ½ vα»›i cΓ’u nΓ³i "Điều duy nhαΊ₯t nguy hiểm hΖ‘n sα»± ngu dα»‘t lΓ  sα»± kiΓͺu ngαΊ‘o" ? πŸ‘» :

TΓ΄i Δ‘α»“ng Γ½ vα»›i cΓ’u nΓ³i "Điều duy nhαΊ₯t nguy hiểm hΖ‘n sα»± ngu dα»‘t lΓ  sα»± kiΓͺu ngαΊ‘o". KiΓͺu ngαΊ‘o lΓ  mα»™t Δ‘α»©c tΓ­nh cΓ³ thể dαΊ«n Δ‘αΊΏn nhiều hαΊ­u quαΊ£ tiΓͺu cα»±c, chαΊ³ng hαΊ‘n nhΖ° sα»± tα»± mΓ£n, sα»± Γ­ch kα»· vΓ  sα»± thiαΊΏu Δ‘α»“ng cαΊ£m. Trong khi Δ‘Γ³, sα»± ngu dα»‘t chỉ lΓ  mα»™t thΓ³i hΖ°α»›ng xαΊ₯u thường xuαΊ₯t phΓ‘t tα»« sα»± thiαΊΏu hiểu biαΊΏt hoαΊ·c thiαΊΏu kinh nghiệm. MαΊ·c dΓΉ sα»± ngu dα»‘t cΕ©ng cΓ³ thể gΓ’y ra mα»™t sα»‘ vαΊ₯n đề, nhΖ°ng nhα»―ng vαΊ₯n đề nΓ y thường khΓ΄ng nghiΓͺm trọng bαΊ±ng nhα»―ng vαΊ₯n đề mΓ  kiΓͺu ngαΊ‘o gΓ’y ra.

VΓ­ dα»₯, mα»™t người ngu dα»‘t cΓ³ thể nΓ³i nhα»―ng lời ngα»› ngαΊ©n hoαΊ·c lΓ m nhα»―ng việc vα»₯ng về, nhΖ°ng họ thường vαΊ«n cΓ³ thể học hỏi tα»« nhα»―ng sai lαΊ§m của mΓ¬nh vΓ  cαΊ£i thiện bαΊ£n thΓ’n. Ngược lαΊ‘i, mα»™t người kiΓͺu ngαΊ‘o thường sαΊ½ khΓ΄ng chα»‹u học hỏi tα»« nhα»―ng sai lαΊ§m của mΓ¬nh vΓ  luΓ΄n tin rαΊ±ng mΓ¬nh Δ‘ΓΊng, ngay cαΊ£ khi mΓ¬nh sai. Điều nΓ y cΓ³ thể dαΊ«n Δ‘αΊΏn nhiều vαΊ₯n đề, chαΊ³ng hαΊ‘n nhΖ° sα»± thαΊ₯t bαΊ‘i trong cΓ΄ng việc hoαΊ·c cΓ‘c mα»‘i quan hệ.

Do Δ‘Γ³, tΓ΄i cho rαΊ±ng cΓ’u nΓ³i "Điều duy nhαΊ₯t nguy hiểm hΖ‘n sα»± ngu dα»‘t lΓ  sα»± kiΓͺu ngαΊ‘o" lΓ  Δ‘ΓΊng.

Explore the model's literary understanding by providing meaningful story prompts, asking to identify what the story is.

πŸ‘¨β€πŸ’» : CΓ’u chuyện cΓ³ nα»™i dung vΓ  Γ½ nghΔ©a chα»©a Δ‘α»±ng mα»™t thΓ΄ng Δ‘iệp Γ½ nghΔ©a lα»›n Δ‘αΊΏn tαΊ₯t cαΊ£ mọi người, Δ‘Γ³ lΓ  tΓ¬nh Δ‘oΓ n kαΊΏt, khao khΓ‘t cho sα»± hΓ²a bΓ¬nh vΓ  nghα»‹ lα»±c phi thường trΖ°α»›c mọi khΓ³ khΔƒn. CΓ³ nhΓ’n vαΊ­t chΓ­nh lΓ  loΓ i dαΊΏ. CΓ’u hỏi: cΓ’u chuyện Δ‘Γ³ của tΓ‘c giαΊ£ nΓ o ? πŸ‘» :

CΓ’u chuyện "DαΊΏ MΓ¨n phiΓͺu lΖ°u kΓ½" của TΓ΄ HoΓ i.

GiαΊ£i thΓ­ch:

  • "DαΊΏ MΓ¨n phiΓͺu lΖ°u kΓ½" lΓ  mα»™t tΓ‘c phαΊ©m vΔƒn học nα»•i tiαΊΏng của nhΓ  vΔƒn TΓ΄ HoΓ i, được sΓ‘ng tΓ‘c nΔƒm 1941.
  • TΓ‘c phαΊ©m kể về cuα»™c phiΓͺu lΖ°u của DαΊΏ MΓ¨n, mα»™t chΓΊ dαΊΏ nhỏ sα»‘ng trong mα»™t ngΓ΄i lΓ ng nhỏ. Trong quΓ‘ trΓ¬nh phiΓͺu lΖ°u, DαΊΏ MΓ¨n Δ‘Γ£ gαΊ·p gα»‘ vΓ  học hỏi nhiều Δ‘iều về cuα»™c sα»‘ng, về tΓ¬nh yΓͺu, về sα»± hy sinh vΓ  về sα»©c mαΊ‘nh của tΓ¬nh Δ‘oΓ n kαΊΏt.
  • TΓ‘c phαΊ©m thể hiện rΓ΅ tinh thαΊ§n Δ‘oΓ n kαΊΏt, khao khΓ‘t cho sα»± hΓ²a bΓ¬nh vΓ  nghα»‹ lα»±c phi thường của con người trΖ°α»›c mọi khΓ³ khΔƒn, thα»­ thΓ‘ch. ĐÒy chΓ­nh lΓ  thΓ΄ng Δ‘iệp Γ½ nghΔ©a lα»›n của cΓ’u chuyện "DαΊΏ MΓ¨n phiΓͺu lΖ°u kΓ½".

The ability to reason to the answer based on the characteristics of is provided.

πŸ‘¨β€πŸ’» : Con vαΊ­t nΓ o lα»›n hΖ‘n con chuα»™t, nhỏ hΖ‘n con Voi, khΓ΄ng quΓ‘ lα»›n, khΓ΄ng phαΊ£i con chΓ³ vΓ  thường được nuΓ΄i ở nhΓ  ? πŸ‘» :

Con mΓ¨o lΓ  loΓ i Δ‘α»™ng vαΊ­t lα»›n hΖ‘n con chuα»™t nhΖ°ng nhỏ hΖ‘n con Voi, khΓ΄ng quΓ‘ lα»›n, khΓ΄ng phαΊ£i con chΓ³ vΓ  thường được nuΓ΄i ở nhΓ .

Try coding skills

Try asking the Typescript coding model to perform finding the second largest number in the array to see if it works?

πŸ‘¨β€πŸ’» : ViαΊΏt mΓ£ TypeScript để tαΊ‘o mα»™t hΓ m thα»±c hiện chα»©c nΔƒng: cho mαΊ£ng toΓ n sα»‘ nguyΓͺn, tΓ¬m sα»‘ lα»›n thα»© hai trong mαΊ£ng. πŸ‘» :
/**
 * Tìm số lớn thứ hai trong mảng.
 *
 * @param {number[]} arr MαΊ£ng cΓ‘c sα»‘ nguyΓͺn.
 * @returns {number} Sα»‘ lα»›n thα»© hai trong mαΊ£ng.
 */
function findSecondLargest(arr: number[]): number {
  // Kiểm tra xem mαΊ£ng cΓ³ Γ­t nhαΊ₯t 2 phαΊ§n tα»­ khΓ΄ng.
  if (arr.length < 2) {
    throw new Error('MαΊ£ng phαΊ£i cΓ³ Γ­t nhαΊ₯t 2 phαΊ§n tα»­.');
  }

  // TΓ¬m sα»‘ lα»›n nhαΊ₯t vΓ  sα»‘ lα»›n thα»© hai trong mαΊ£ng.
  let largest = arr[0];
  let secondLargest = Number.MIN_SAFE_INTEGER;
  for (let i = 1; i < arr.length; i++) {
    if (arr[i] > largest) {
      secondLargest = largest;
      largest = arr[i];
    } else if (arr[i] > secondLargest && arr[i] != largest) {
      secondLargest = arr[i];
    }
  }

  // TrαΊ£ về sα»‘ lα»›n thα»© hai.
  return secondLargest;
}

GiαΊ£i thΓ­ch:

  1. Kiểm tra xem mαΊ£ng cΓ³ Γ­t nhαΊ₯t 2 phαΊ§n tα»­ khΓ΄ng. NαΊΏu mαΊ£ng chỉ cΓ³ 1 phαΊ§n tα»­ hoαΊ·c Γ­t hΖ‘n, thΓ¬ khΓ΄ng cΓ³ sα»‘ lα»›n thα»© hai trong mαΊ£ng. TrαΊ£ về lα»—i nαΊΏu Δ‘iều kiện nΓ y Δ‘ΓΊng.
  2. Khởi tαΊ‘o hai biαΊΏn largest vΓ  secondLargest vα»›i giΓ‘ trα»‹ ban Δ‘αΊ§u lΓ  phαΊ§n tα»­ Δ‘αΊ§u tiΓͺn của mαΊ£ng vΓ  sα»‘ nguyΓͺn nhỏ nhαΊ₯t cΓ³ thể biểu diα»…n được trong JavaScript (Number.MIN_SAFE_INTEGER), tΖ°Ζ‘ng Δ‘Ζ°Ζ‘ng vα»›i Integer.MIN_VALUE trong Java.
  3. Duyệt qua tα»«ng phαΊ§n tα»­ trong mαΊ£ng, bαΊ―t Δ‘αΊ§u tα»« phαΊ§n tα»­ thα»© hai. NαΊΏu phαΊ§n tα»­ hiện tαΊ‘i lα»›n hΖ‘n largest, thΓ¬ cαΊ­p nhαΊ­t secondLargest bαΊ±ng largest vΓ  largest bαΊ±ng phαΊ§n tα»­ hiện tαΊ‘i. NαΊΏu phαΊ§n tα»­ hiện tαΊ‘i lα»›n hΖ‘n secondLargest nhΖ°ng nhỏ hΖ‘n largest, thΓ¬ cαΊ­p nhαΊ­t secondLargest bαΊ±ng phαΊ§n tα»­ hiện tαΊ‘i.
  4. Sau khi duyệt qua tαΊ₯t cαΊ£ cΓ‘c phαΊ§n tα»­ trong mαΊ£ng, trαΊ£ về secondLargest. ĐÒy chΓ­nh lΓ  sα»‘ lα»›n thα»© hai trong mαΊ£ng.

Now let's try asking for a coding model to build a smooth neural network with python.

πŸ‘¨β€πŸ’» : TrΓ¬nh bΓ y cΓ‘ch sα»­ dα»₯ng thΖ° viện Keras hoαΊ·c TensorFlow trong Python để xΓ’y dα»±ng vΓ  huαΊ₯n luyện mαΊ‘ng nΖ‘-ron Δ‘a lα»›p cho bΓ i toΓ‘n phΓ’n loαΊ‘i αΊ£nh. πŸ‘» :

Sα»­ dα»₯ng thΖ° viện Keras:

  1. NhαΊ­p thΖ° viện Keras:
import keras.models
  1. Tẑo một mô hình mẑng nƑ-ron đa lớp:
model = keras.models.Sequential()
model.add(keras.layers.Conv2D(32, (3, 3), activation='relu', input_shape=(224, 224, 3)))
model.add(keras.layers.MaxPooling2D((2, 2)))
model.add(keras.layers.Flatten())
model.add(keras.layers.Dense(128, activation='relu'))
model.add(keras.layers.Dense(2, activation='softmax'))
  1. BiΓͺn dα»‹ch vΓ  huαΊ₯n luyện mΓ΄ hΓ¬nh:
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(x_train, y_train, epochs=10, validation_data=(x_test, y_test))

Sα»­ dα»₯ng thΖ° viện TensorFlow:

  1. NhαΊ­p thΖ° viện TensorFlow:
import tensorflow as tf
  1. Tẑo một mô hình mẑng nƑ-ron đa lớp:
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Conv2D(32, (3, 3), activation='relu', input_shape=(224, 224, 3)))
model.add(tf.keras.layers.MaxPooling2D((2, 2)))
model.add(tf.keras.layers.Flatten())
model.add(tf.keras.layers.Dense(128, activation='relu'))
model.add(tf.keras.layers.Dense(2, activation='softmax'))
  1. BiΓͺn dα»‹ch vΓ  huαΊ₯n luyện mΓ΄ hΓ¬nh:
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(x_train, y_train, epochs=10, validation_data=(x_test, y_test))

LΖ°u Γ½:

  • BαΊ‘n cΓ³ thể sα»­ dα»₯ng cΓ‘c lα»›p mαΊ‘ng nΖ‘-ron khΓ‘c nhau trong mΓ΄ hΓ¬nh, chαΊ³ng hαΊ‘n nhΖ° lα»›p mαΊ‘ng nΖ‘-ron tΓ­ch chαΊ­p (Conv2D), lα»›p mαΊ‘ng nΖ‘-ron lαΊ₯y mαΊ«u (MaxPooling2D), lα»›p mαΊ‘ng nΖ‘-ron Δ‘αΊ§y đủ kαΊΏt nα»‘i (Dense), lα»›p mαΊ‘ng nΖ‘-ron softmax, v.v.
  • BαΊ‘n cΓ³ thể Δ‘iều chỉnh sα»‘ lα»›p, sα»‘ nΖ‘-ron trong mα»—i lα»›p vΓ  sα»‘ lαΊ§n lαΊ·p (epochs) để tα»‘i Ζ°u hΓ³a mΓ΄ hΓ¬nh cho bΓ i toΓ‘n cα»₯ thể của bαΊ‘n.
  • BαΊ‘n cΓ³ thể sα»­ dα»₯ng cΓ‘c kα»Ή thuαΊ­t huαΊ₯n luyện bα»• sung nhΖ° dropout, regularization vΓ  early stopping để cαΊ£i thiện hiệu suαΊ₯t của mΓ΄ hΓ¬nh.

Try asking the model about common errors when deploying and using K8S to see what results the model gives.

πŸ‘¨β€πŸ’» : Nhα»―ng lα»—i thường gαΊ·p trong quΓ‘ trΓ¬nh sα»­ dα»₯ng K8S lΓ  gΓ¬ ? HΓ£y nΓͺu cΓ‘ch khαΊ―c phα»₯c. πŸ‘» :

Nhα»―ng lα»—i thường gαΊ·p trong quΓ‘ trΓ¬nh sα»­ dα»₯ng Kubernetes:

1. Lα»—i cαΊ₯u hΓ¬nh:

  • MΓ‘y chủ Kubernetes khΓ΄ng được cαΊ₯u hΓ¬nh Δ‘ΓΊng: Kiểm tra cαΊ₯u hΓ¬nh mΓ‘y chủ Kubernetes (master node) để Δ‘αΊ£m bαΊ£o rαΊ±ng cΓ‘c thΓ΄ng sα»‘ cαΊ§n thiαΊΏt nhΖ° IP, cα»•ng, tΓͺn miền, tΓͺn miền SSL, v.v. được Δ‘αΊ·t Δ‘ΓΊng.
  • CΓ‘c pod khΓ΄ng được cαΊ₯u hΓ¬nh Δ‘ΓΊng: Kiểm tra cαΊ₯u hΓ¬nh pod để Δ‘αΊ£m bαΊ£o rαΊ±ng cΓ‘c yαΊΏu tα»‘ nhΖ° image, lΖ°u trα»―, mαΊ‘ng, v.v. được Δ‘αΊ·t Δ‘ΓΊng.
  • CΓ‘c tΓ i nguyΓͺn (resource) khΓ΄ng được cαΊ₯p phΓ‘t Δ‘ΓΊng: Kiểm tra xem cΓ‘c tΓ i nguyΓͺn nhΖ° CPU, bα»™ nhα»›, lΖ°u trα»―, v.v. được cαΊ₯p phΓ‘t cho cΓ‘c pod cΓ³ đủ hay khΓ΄ng.

2. Lα»—i mαΊ‘ng:

  • MαΊ‘ng khΓ΄ng được cαΊ₯u hΓ¬nh Δ‘ΓΊng: Kiểm tra cαΊ₯u hΓ¬nh mαΊ‘ng để Δ‘αΊ£m bαΊ£o rαΊ±ng cΓ‘c Δ‘α»‹a chỉ IP, cα»•ng, tΓͺn miền, tΓͺn miền SSL, v.v. được cαΊ₯u hΓ¬nh Δ‘ΓΊng.
  • Lα»—i mαΊ‘ng giα»―a cΓ‘c node: Kiểm tra xem cΓ³ lα»—i mαΊ‘ng giα»―a cΓ‘c node trong cα»₯m Kubernetes hay khΓ΄ng. CΓ³ thể sα»­ dα»₯ng cΓ‘c cΓ΄ng cα»₯ nhΖ° netstat, ifconfig, tcpdump để kiểm tra.
  • Lα»—i mαΊ‘ng giα»―a cΓ‘c pod: Kiểm tra xem cΓ³ lα»—i mαΊ‘ng giα»―a cΓ‘c pod trong mα»™t node hay khΓ΄ng. CΓ³ thể sα»­ dα»₯ng cΓ‘c cΓ΄ng cα»₯ nhΖ° netstat, ifconfig, tcpdump để kiểm tra.

3. Lα»—i phαΊ§n cα»©ng:

  • PhαΊ§n cα»©ng khΓ΄ng đủ mαΊ‘nh: Kiểm tra xem phαΊ§n cα»©ng mΓ‘y chủ Kubernetes cΓ³ đủ mαΊ‘nh để chαΊ‘y cα»₯m Kubernetes hay khΓ΄ng. Cα»₯ thể, kiểm tra xem CPU, bα»™ nhα»›, lΖ°u trα»―, v.v. cΓ³ đủ hay khΓ΄ng.
  • PhαΊ§n cα»©ng bα»‹ lα»—i: Kiểm tra xem phαΊ§n cα»©ng mΓ‘y chủ Kubernetes cΓ³ bα»‹ lα»—i hay khΓ΄ng. CΓ³ thể sα»­ dα»₯ng cΓ‘c cΓ΄ng cα»₯ nhΖ° lshw, dmesg để kiểm tra.

4. Lα»—i phαΊ§n mềm:

  • PhαΊ§n mềm Kubernetes khΓ΄ng được cαΊ­p nhαΊ­t: Kiểm tra xem phαΊ§n mềm Kubernetes Δ‘ang sα»­ dα»₯ng cΓ³ được cαΊ­p nhαΊ­t Δ‘αΊΏn phiΓͺn bαΊ£n mα»›i nhαΊ₯t hay khΓ΄ng. CαΊ­p nhαΊ­t phαΊ§n mềm Kubernetes thường giΓΊp khαΊ―c phα»₯c cΓ‘c lα»—i bαΊ£o mαΊ­t vΓ  cαΊ£i thiện hiệu suαΊ₯t.
  • PhαΊ§n mềm Kubernetes cΓ³ lα»—i: Kiểm tra xem phαΊ§n mềm Kubernetes cΓ³ lα»—i hay khΓ΄ng. CΓ³ thể sα»­ dα»₯ng cΓ‘c cΓ΄ng cα»₯ nhΖ° journal, dmesg để kiểm tra.
  • CΓ‘c α»©ng dα»₯ng khΓ‘ch khΓ΄ng được cαΊ­p nhαΊ­t: Kiểm tra xem cΓ‘c α»©ng dα»₯ng khΓ‘ch Δ‘ang sα»­ dα»₯ng trΓͺn cα»₯m Kubernetes cΓ³ được cαΊ­p nhαΊ­t Δ‘αΊΏn phiΓͺn bαΊ£n mα»›i nhαΊ₯t hay khΓ΄ng. CαΊ­p nhαΊ­t cΓ‘c α»©ng dα»₯ng khΓ‘ch thường giΓΊp khαΊ―c phα»₯c cΓ‘c lα»—i bαΊ£o mαΊ­t vΓ  cαΊ£i thiện hiệu suαΊ₯t.

CΓ‘ch khαΊ―c phα»₯c:

  • Lα»—i cαΊ₯u hΓ¬nh: Sα»­a cΓ‘c thΓ΄ng sα»‘ cαΊ₯u hΓ¬nh sai trong mΓ‘y chủ Kubernetes vΓ  cΓ‘c pod. VΓ­ dα»₯: Δ‘αΊ£m bαΊ£o rαΊ±ng mΓ‘y chủ Kubernetes cΓ³ Δ‘α»‹a chỉ IP vΓ  cα»•ng phΓΉ hợp, cΓ‘c pod cΓ³ image vΓ  lΖ°u trα»― phΓΉ hợp, v.v.
  • Lα»—i mαΊ‘ng: Sα»­a cΓ‘c vαΊ₯n đề về mαΊ‘ng giα»―a cΓ‘c node vΓ  cΓ‘c pod. VΓ­ dα»₯: Δ‘αΊ£m bαΊ£o rαΊ±ng mαΊ‘ng được cαΊ₯u hΓ¬nh Δ‘ΓΊng, kiểm tra xem cΓ³ lα»—i mαΊ‘ng giα»―a cΓ‘c node hay khΓ΄ng, kiểm tra xem cΓ³ lα»—i mαΊ‘ng giα»―a cΓ‘c pod hay khΓ΄ng, v.v.
  • Lα»—i phαΊ§n cα»©ng: NΓ’ng cαΊ₯p phαΊ§n cα»©ng mΓ‘y chủ Kubernetes nαΊΏu cαΊ§n thiαΊΏt. VΓ­ dα»₯: tΔƒng CPU, bα»™ nhα»›, lΖ°u trα»―, v.v.
  • Lα»—i phαΊ§n mềm: CαΊ­p nhαΊ­t phαΊ§n mềm Kubernetes vΓ  cΓ‘c α»©ng dα»₯ng khΓ‘ch. VΓ­ dα»₯: cαΊ­p nhαΊ­t phiΓͺn bαΊ£n mα»›i nhαΊ₯t của Kubernetes, cαΊ­p nhαΊ­t cΓ‘c bαΊ£n vΓ‘ lα»—i bαΊ£o mαΊ­t cho cΓ‘c α»©ng dα»₯ng khΓ‘ch, v.v.

LΖ°u Γ½: Khi gαΊ·p phαΊ£i lα»—i trong quΓ‘ trΓ¬nh sα»­ dα»₯ng Kubernetes, cαΊ§n phαΊ£i xΓ‘c Δ‘α»‹nh rΓ΅ nguyΓͺn nhΓ’n gα»‘c rα»… của lα»—i trΖ°α»›c khi cΓ³ thể khαΊ―c phα»₯c. Việc xΓ‘c Δ‘α»‹nh nguyΓͺn nhΓ’n gα»‘c rα»… sαΊ½ giΓΊp bαΊ‘n tiαΊΏt kiệm thời gian vΓ  cΓ΄ng sα»©c khi khαΊ―c phα»₯c lα»—i.

Tools / Function calls

The model is trained to be able to choose the right tools to use and to provide useful and accurate answers to the questions it receives. In this example, the model is asked for some information about Apple stock.

Explain

This is the standard for declaring model tools, in json format. Also, See more about the model's prompt / chat template.

[
  {
    "type": "function",
    "function": {
      "name": "get_stock_info",
      "description": "Get stock information",
      "parameters": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "Stock ticker",
            "required": true
          }
        }
      }
    }
  }
]

Workflow

Turn 1

To use the tools, the model's supporting role is plugin which includes the declared tooling schema. Below is an example of messages with turn 1 to use.

# A question about Apple stocks in English language.
question = "What is Apple's market capitalization today?"
# It's still the same question but in Vietnamese languae.
# question = "Vα»‘n hoΓ‘ thα»‹ trường Apple hΓ΄m nay lΓ  bao nhiΓͺu ?"

plugins = [
  {
    "type": "function",
    "function": {
      "name": "get_stock_info",
      "description": "Get stock information",
      "parameters": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "Stock ticker",
            "required": True,
          }
        },
      },
    },
  }
]

messages = [
  {"role": "system", "content": ""},
  {"role": "plugins", "content": json.dumps(plugins, ensure_ascii=False)},
  {"role": "user", "content": question},
]

output = generate_sample(
  messages=messages,
  max_new_tokens=256, temperature=0.4, top_k=50, top_p=0.95,
)

At this point, the model will return output as the primitive value as follows:

[execute]({"type": "function", "function": "get_stock_info", "arguments": {"ticker": "AAPL"}})

Use the get_tools function to parse the readable and usable results.

{
  "type": "function",
  "function": "get_stock_info",
  "arguments": {
    "ticker": "AAPL"
  }
}

Turn 2

Get information about tools to use with arguments. Use it to execute and return data, here we will assume the return data is as follows, sampled from polygon.io (cleaned up):

{
  "request_id": "1ffbab9cc78c7addbd8deaab05bdaf6d",
  "results": {
    "ticker": "AAPL",
    "name": "Apple Inc.",
    "market_cap": 2620023949270,
    "description": "Apple is among the largest companies in the world, with a broad portfolio of hardware and software products targeted at consumers and businesses. Apple's iPhone makes up a majority of the firm sales, and Apple's other products like Mac, iPad, and Watch are designed around the iPhone as the focal point of an expansive software ecosystem. Apple has progressively worked to add new applications, like streaming video, subscription bundles, and augmented reality. The firm designs its own software and semiconductors while working with subcontractors like Foxconn and TSMC to build its products and chips. Slightly less than half of Apple's sales come directly through its flagship stores, with a majority of sales coming indirectly through partnerships and distribution.",
    "ticker_root": "AAPL",
    "homepage_url": "https://www.apple.com",
    "total_employees": 161000,
    ...
  },
  "status": "OK"
}

Continue using the model to answer user questions based on the data returned from the tool.

executes = {
  "type": "function",
  "function": "get_stock_info",
  "arguments": {
    "ticker": "AAPL"
  }
}

results = {
  "request_id": "1ffbab9cc78c7addbd8deaab05bdaf6d",
  "results": {
    "ticker": "AAPL",
    "name": "Apple Inc.",
    "market_cap": 2620023949270,
    "description": "Apple is among the largest companies in the world, with a broad portfolio of hardware and software products targeted at consumers and businesses. Apple's iPhone makes up a majority of the firm sales, and Apple's other products like Mac, iPad, and Watch are designed around the iPhone as the focal point of an expansive software ecosystem. Apple has progressively worked to add new applications, like streaming video, subscription bundles, and augmented reality. The firm designs its own software and semiconductors while working with subcontractors like Foxconn and TSMC to build its products and chips. Slightly less than half of Apple's sales come directly through its flagship stores, with a majority of sales coming indirectly through partnerships and distribution.",
    "ticker_root": "AAPL",
    "homepage_url": "https://www.apple.com",
    "total_employees": 161000,
  },
  "status": "OK"
}

messages = [
  {"role": "system", "content": ""},
  {"role": "plugins","content": json.dumps(plugins, ensure_ascii=False)},
  {"role": "user","content": question},
  # Keep the value of `messages` from before, just add new items below.
  {"role": "execute","content": json.dumps(executes, ensure_ascii=False)},
  {"role": "response","content": json.dumps(results, ensure_ascii=False)},
]

output = generate_sample(
  messages=messages,
  max_new_tokens=256, temperature=0.4, top_k=50, top_p=0.95,
)

The value of output returned by the model will now be similar to the following.

For the question is English.

Apple's market capitalization today is $2.62 trillion.

And the question is Vietnamese.

Vα»‘n hoΓ‘ thα»‹ trường của Apple hΓ΄m nay lΓ  **2.620 tα»· Δ‘Γ΄ la**. πŸ’°

Usage

The model is trained to serve well and balance general tasks, so there will be many approaches when used for production.

Things to know

Recommendations

General tasks

Experience it to find the right fit for your own desires. Below are some suggestions that you might consider.

Answer the questions

In this task, the model can be integrated to develop RAG products to help answer questions for customer care departments, questions about internal documents, policies, product information, order details, etc.

Coding support

In this task, the model can help find errors or write algorithms and functions that help speed up the domain development process and improve product quality.

Content creation

In this task, the model can give suggestions for building layouts and content samples that need high creativity and personality in the content.

Other

Don't limit your creativity to the model. Feel free to experience it and use it to build good things.

Virtual assistant

An understanding of the language along with the overall capabilities of the model, may be suitable for integrating its development as a set of one or more tasks in the development of an intelligent virtual assistant.

The model is trained to understand and empathize emotionally, making the response more natural and understanding. This also helps a lot with this request.

As a pre-training

The model can be further trained to serve the desired tasks better and more effectively if it cannot satisfy the given requirements. Taking advantage of the model's current superior inference and multi-tasking capabilities, training it for a few separate tasks will help save a lot of effort, time and cost for the project.

Revealed, the model has been integrated to replace some tasks that were previously used by OpenAI GPT4 in the business/product that the founder has been working on. For those tasks, the model is considered effective compared to the cost and is very worthy.

Bias and limitations

In addition, there are some things you need to know before using as follows:

Generation configuration

The temperature affects the truth of the answer. Setting a temperature value greater than 0.2 - 0.4 will result in a more creative answer but may affect the accuracy of the answer, please consider this based on your task.

Hint: you can write a prompt to receive input and ask the model to choose the appropriate temperature based on the question, useful in the case of virtual assistant development.

Emotion bias and empathy

The model is built with an emotional bias and takes positions when faced with problems or reasoning questions. This can be good or bad depending on the context. If you don't want the model to be rigid in asking certain questions or problems, set up rules in the system prompt for it.

This bias often appears when the model's system prompt sets it up as an assistant and mentions that it needs to have empathy for/with a certain user/experience. This is intentional during the model training process, it does not come from something unforeseen.

Directly

To use the model directly, there are many ways to get started, choose one of the following ways to experience it.

Transformers

For direct use with transformers, you can easily get started with the following steps.

  • Firstly, you need to install transformers via the command below with pip.

    pip install -U transformers
    
  • Right now, you can start using the model directly.

    import torch
    from transformers import (
        AutoModelForCausalLM,
        AutoTokenizer,
    )
    
    base_model = "ghost-x/ghost-7b-alpha"
    model = AutoModelForCausalLM.from_pretrained(
        base_model,
        torch_dtype=torch.bfloat16,
        device_map="auto",
    )
    tokenizer = AutoTokenizer.from_pretrained(base_model)
    
    messages = [
        {"role": "system", "content": ""},
        {"role": "user", "content": "Why is the sky blue ?"},
        # {"role": "user", "content": "Tẑi sao bầu trời lẑi màu xanh ?"},
    ]
    prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
    for k,v in inputs.items():
        inputs[k] = v.cuda()
    outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_k=50, top_p=0.95, temperature=0.4)
    results = tokenizer.batch_decode(outputs)[0]
    print(results)
    
  • Additionally, you can also use a model with 4bit quantization to reduce the required resources at least. You can start with the code below.

    import torch
    from transformers import (
        AutoModelForCausalLM,
        AutoTokenizer,
        BitsAndBytesConfig,
    )
    
    base_model = "ghost-x/ghost-7b-alpha"
    bnb_config = BitsAndBytesConfig(
        load_in_4bit=True,
        bnb_4bit_quant_type="nf4",
        bnb_4bit_compute_dtype=torch.bfloat16,
        bnb_4bit_use_double_quant=False,
    )
    model = AutoModelForCausalLM.from_pretrained(
        base_model,
        quantization_config=bnb_config,
        device_map="auto",
    )
    tokenizer = AutoTokenizer.from_pretrained(base_model)
    
    messages = [
        {"role": "system", "content": ""},
        {"role": "user", "content": "Why is the sky blue ?"},
        # {"role": "user", "content": "Tẑi sao bầu trời lẑi màu xanh ?"},
    ]
    prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
    for k,v in inputs.items():
        inputs[k] = v.cuda()
    outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_k=50, top_p=0.95, temperature=0.4)
    results = tokenizer.batch_decode(outputs)[0]
    print(results)
    

Unsloth

For direct use with unsloth, you can easily get started with the following steps.

  • Firstly, you need to install unsloth via the command below with pip.

    pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
    pip install --no-deps xformers trl peft accelerate bitsandbytes
    
  • Initialize and optimize the model before use.

    from unsloth import FastLanguageModel
    import torch
    
    base_model = "ghost/ghost-7b-alpha"
    model, tokenizer = FastLanguageModel.from_pretrained(
        model_name = base_model,
        max_seq_length = 8192,
        dtype = None,
        load_in_4bit = True, # Change to `False` if you don't want to use 4bit quantization.
    )
    FastLanguageModel.for_inference(model)
    
  • Right now, you can start using the model directly.

    messages = [
        {"role": "system", "content": ""},
        {"role": "user", "content": "Why is the sky blue ?"},
        # {"role": "user", "content": "Tẑi sao bầu trời lẑi màu xanh ?"},
    ]
    prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
    for k,v in inputs.items():
        inputs[k] = v.cuda()
    outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_k=50, top_p=0.95, temperature=0.4)
    results = tokenizer.batch_decode(outputs)[0]
    print(results)
    

Online

The content of this document will be updated soon. The documentation will guide usage through providers such as Huggingface Inference API, Together AI, or Replicate.

Playground

To make it easy for everyone to quickly experience the model through platforms like Google Colab and Kaggle. We’ve made these notebooks available so you can get started right away. See available notebooks with details here.

We offer notebooks with a wide selection of tools and platforms so you can easily get started. Here are some available options for you to try right now. Let’s pick one to get started.

There are currently two language versions: English and Vietnamese. In each version, it will be almost the same. The content will include installation instructions and functions to help get started quickly with experiencing the model's text generation capabilities. In addition, it also provides examples with system prompts for each field so you can better understand them.

Playground using Transformers

Playground using Unsloth

Revealing, experience with Kaggle will give you much better results in creating documents than Colab. We recommend using Kaggle.

Deployments

The models developed by Ghost X have the same goal of being easy to integrate and use in practice to save costs and facilitate development for the community and startups.

For production deployment with small to large infrastructure, please see more detailed instructions in this article. The article will provide the most common and effective deployment solutions with leading, trusted libraries such as vLLM and more. In addition, it also has information about more optimal solutions and methods depending on each need to be able to choose the appropriate solution.

Evaluation

To ensure effective model development, we ran popular evaluations to give everyone a broader view of the model's capabilities. We had to work to balance the quality between the English and Vietnamese languages to ensure the model still performed well in both of these primary languages.

In addition, if your goals are oriented towards a certain main language, you can refer to the advanced user guide to improve model quality for the tasks and languages you desire.

Open LLM Leaderboard

The results of this evaluation will be updated soon.

MT-Bench

MT-bench is a challenging multi-turn question set designed to evaluate the conversational and instruction-following ability of models. [source from lmsys.org]

Ghost 7B Alpha achieved a decent score for the MT-Bench review, we worked hard to balance the reasoning ability and linguistic insight of both primary languages, English and Vietnamese. Overall, it was able to outperform some large language models such as tulu-30b, guanaco-65b, and mpt-30b-chat which are many times larger.

Model Score
gpt-4 8.990625
gpt-3.5-turbo 7.943750
claude-instant-v1 7.905660
claude-v1 7.900000
vicuna-33b-v1.3 7.121875
wizardlm-30b 7.009375
Llama-2-70b-chat 6.856250
Llama-2-13b-chat 6.650000
guanaco-33b 6.528125
ghost-7b-alpha 6.481250
tulu-30b 6.434375
oasst-sft-7-llama-30b 6.409375
guanaco-65b 6.409375
palm-2-chat-bison-001 6.400000
mpt-30b-chat 6.393750
vicuna-13b-v1.3 6.387500
wizardlm-13b 6.353125

AlpacaEval

AlpacaEval is an automated tool for evaluating instruction-following language models against the AlpacaFarm dataset. It stands out for its human-validated, high-quality assessments that are both cost-effective and rapid. [source from klu.ai]

Similarly, in this evaluation the model achieved good performance as it outperformed larger sized models such as vicuna-13b, guanaco-33b, and nous-hermes-13b.

Model Winrate
gpt4 95.279503
Mixtral-8x7B-Instruct-v0.1 94.782608
claude-2.1 87.080745
gpt-3.5-turbo-1106 86.256218
zephyr-7b-alpha 85.758706
gpt35_turbo_instruct 81.710362
gemini-pro 79.664179
... ...
ghost-7b-alpha 70.440251
vicuna-13b 70.434782
guanaco-33b 65.962732
nous-hermes-13b 65.465838
... ...

Notes

Thanks

After all, the project also wants to send sincere thanks to the products that have supported the project's development.

Unsloth

Unsloth, a great tool that helps us easily develop products, at a lower cost than expected.

Kaggle

Kaggle, generous hours of free notebooks for research projects.

And...

Good friends, who have accompanied the project, Luan Nguyen and Phu Tran.

Confidence

In addition to the Ghost 7B Alpha project, Ghost X always wants to develop and improve many better models in the future, better supporting the community and businesses with the most openness possible.

Revealing the Ghost 7B Beta project plan. This model is expected to outperform with a deeper focus on multi-tasking, math, and reasoning. Along with that is the ability to expand context length and support other languages (highly requested languages).

The organization is being operated and developed by Hieu Lam's personal resources, if there is any development support or consulting request. Please feel free to contact the organization, we are very happy about this. Directly via email: [email protected].

Ghost X is happy to support providing models for server providers, aiming to help startups develop better.

Contact

Follow Ghost X to stay updated with the latest information.

Downloads last month
4,934
Safetensors
Model size
7.24B params
Tensor type
BF16
Β·
Inference Examples
Input a message to start chatting with ghost-x/ghost-7b-alpha.
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for ghost-x/ghost-7b-alpha

Finetunes
7 models
Quantizations
3 models

Spaces using ghost-x/ghost-7b-alpha 3

Collection including ghost-x/ghost-7b-alpha