Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a dice toss skill #355

Closed
wants to merge 14 commits into from
Closed

Conversation

shairevivo
Copy link

adding a skill to toss a dice

If your PR is related to a contribution to the taxonomy, please, fill
out the following questionnaire. If not, replace this whole text and the
following questionnaire with whatever information is applicable to your PR.

**I have added a skill to roll \ toss a dice (any number of dice) **

Added the ability to toss a dice, 2 dice and as many as needed.
The chat will return emoji of a dice and the result along with some details on stats \ sum etc.

Input given at the prompt

I added multiple possible questions for tossing a dice or number of dice.

Response that was received

output will be the number \ numbers along with
Example:
Screenshot from 2024-03-11 20-56-54

Response that is now received instead

Added above a screen shot that shows some input \ output on the trained model.

Contribution checklist

adding a skill to toss a dice

Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
@shairevivo shairevivo requested a review from a team as a code owner March 11, 2024 19:26
Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
Updated 2 dice to dice and 1 dice to die. 

Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
@mairin mairin added the skill (Auto labeled) label Mar 16, 2024
Better generation and training results with this fine tuned file 

Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
@shairevivo shairevivo requested a review from a team as a code owner March 19, 2024 07:19
fine tuned file with better training results 

Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
Updated with the source requirements. 

Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
fix trailing spaces

Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
last fix (hopefully)

Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
fixed last line for attribution

Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
qna.yaml Outdated Show resolved Hide resolved
@obuzek
Copy link
Contributor

obuzek commented Mar 22, 2024

Can you please show some output on the original model? I'm not convinced the model needs improvement at this skill.

If this is genuinely a deficit in the model, I'd suggest being able to respond to DnD style "roll 2d20" prompts as well.

It's a cute skill and likely to work - if the improvement is actually needed.

@obuzek obuzek added the triage-requested-changes skill has been reviewed; changes requested from contributor label Mar 22, 2024
Signed-off-by: Shai Revivo <98468006+shairevivo@users.noreply.github.com>
@github-actions github-actions bot added the triage-needed (Auto labeled) skill is ready to be triaged label Mar 23, 2024
@shairevivo
Copy link
Author

Can you please show some output on the original model? I'm not convinced the model needs improvement at this skill.

If this is genuinely a deficit in the model, I'd suggest being able to respond to DnD style "roll 2d20" prompts as well.

It's a cute skill and likely to work - if the improvement is actually needed.

Here is before and after output i captured:
Before:
(venv) [root@dhcp-3-136 instruct-lab]# lab chat
╭─────────────────────────────────────────────────────────────────── system ───────────────────────────────────────────────────────────────────╮
│ Welcome to Chat CLI w/ MERLINITE-7B-Q4_K_M (type /h for help) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

                                                                                                                            [S][default]
                                                                                                                            [S][default]
                                                                                                                            [S][default]

roll 1 dice [S][default]
╭──────────────────────────────────────────────────────────── merlinite-7b-Q4_K_M ─────────────────────────────────────────────────────────────╮
│ A standard dice has 6 faces, each with a different number from 1 to 6. The outcome of rolling a dice is a random process, and the │
│ probability of obtaining each number is equal. Therefore, the probability of rolling a specific number (e.g., 3) on a fair six-sided dice is │
│ 1/6 or approximately 0.167 (rounded to three decimal places). │
│ │
│ To calculate the probability of rolling a number less than or equal to 4 on a fair six-sided dice, we need to consider the possible │
│ outcomes: 1, 2, 3, and 4. The total number of possible outcomes is 4, and the number of favorable outcomes is also 4. Therefore, the │
│ probability of rolling a number less than or equal to 4 is: │
│ │
│ P(X ≤ 4) = Number of favorable outcomes / Total number of possible outcomes = 4/6 = 2/3 ≈ 0.67 (rounded to three decimal places) │
│ │
│ In summary, the probability of rolling a number less than or equal to 4 on a fair six-sided dice is approximately 0.67 or 2/3. │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── elapsed 37.408 seconds ─╯
can you roll 1 dice for me? [S][default]
╭──────────────────────────────────────────────────────────── merlinite-7b-Q4_K_M ─────────────────────────────────────────────────────────────╮
│ Certainly! If you'd like me to simulate the rolling of a fair six-sided dice for you, the outcome is: │
│ │
│ [Random Number] │
│ │
│ In this case, the result is [Random Number]. If you'd like me to generate more random numbers for multiple rolls, please let me know! │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── elapsed 8.809 seconds ─╯
can you roll 2 dice for me [S][default]
╭──────────────────────────────────────────────────────────── merlinite-7b-Q4_K_M ─────────────────────────────────────────────────────────────╮
│ Of course! I'll simulate the rolling of two fair six-sided dice for you. The possible sum of the two rolled numbers ranges from 2 (rolling a │
│ 1 on both dice) to 12 (rolling two 6s). To calculate the probability of rolling a specific sum, we can use the concept of complementary │
│ probability: │
│ │
│ P(X = k) = 1 - P(X ≠ k) │
│ │
│ where X is the sum of the two rolled numbers and k is the desired sum. │
│ │
│ For example, the probability of rolling a sum of 7 is: │
│ │
│ P(X = 7) = 1 - P(X ≠ 7) = 1 - (P(X = 2) + P(X = 3) + P(X = 4) + P(X = 5) + P(X = 6) + P(X = 8) + P(X = 9) + P(X = 10) + P(X = 11) + P(X = │
│ 12)) │
│ │
│ Calculating the probabilities of rolling sums other than 7 follows the same method. Here's the simulation result for rolling two fair │
│ six-sided dice: │
│ │
│ [Random Number 1] + [Random Number 2] = [Simulated Sum] │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── elapsed 45.277 seconds ─╯
cast 2 dice's [S][default]
╭──────────────────────────────────────────────────────────── merlinite-7b-Q4_K_M ─────────────────────────────────────────────────────────────╮
│ In the context of role-playing games or other games that use polyhedral dice, casting two dice refers to rolling two six-sided dice. The │
│ possible sum of the two rolled numbers ranges from 2 (rolling a 1 on both dice) to 12 (rolling two 6s). The probability of rolling a │
│ specific sum can be calculated using the concept of complementary probability, as mentioned earlier. │
│ │
│ If you'd like me to simulate the rolling of two six-sided dice, the result is: │
│ │
│ [Random Number 1] + [Random Number 2] = [Simulated Sum] │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── elapsed 18.378 seconds ─╯

After:
(venv) [root@dhcp-3-136 instruct-lab]# lab chat -m ggml-model-f16.gguf
╭─────────────────────────────────────────────────────────────────────── system ────────────────────────────────────────────────────────────────────────╮
│ Welcome to Chat CLI w/ GGML-MODEL-F16.GGUF (type /h for help) │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

                                                                                                                                     [S][default]
                                                                                                                                     [S][default]
                                                                                                                                     [S][default]

can you toss a dice for me [S][default]
╭───────────────────────────────────────────────────────────────── ggml-model-f16.gguf ─────────────────────────────────────────────────────────────────╮
│ Rolling a dice 🎲🎲 You rolled 4 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── elapsed 5.162 seconds ─╯
roll 1 dice [S][default]
╭───────────────────────────────────────────────────────────────── ggml-model-f16.gguf ─────────────────────────────────────────────────────────────────╮
│ Rolling a dice 🎲🎲 You rolled 1 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── elapsed 5.158 seconds ─╯
can you roll 2 dice for me [S][default]
╭───────────────────────────────────────────────────────────────── ggml-model-f16.gguf ─────────────────────────────────────────────────────────────────╮
│ Rolling 2 dice 🎲🎲🎲🎲 You rolled 4, 3 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── elapsed 8.993 seconds ─╯
cast 2 dice [S][default]
╭───────────────────────────────────────────────────────────────── ggml-model-f16.gguf ─────────────────────────────────────────────────────────────────╮
│ Casting 2 dice 🎲🎲🎲🎲 You cast 9, 6 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── elapsed 9.051 seconds ─╯

BTW, i improved the output a bit since this out put captured but it is obvious the original model is lacking.

@ckadner ckadner added triage-follow-up and removed triage-needed (Auto labeled) skill is ready to be triaged triage-requested-changes skill has been reviewed; changes requested from contributor labels Mar 27, 2024
@jjasghar jjasghar closed this Apr 19, 2024
@n1hility
Copy link
Member

Thank you for your contribution to InstructLab! Unfortunately, once a Github repo is made public, all open PRs are automatically closed since they link against a private repo. We have detected that your PR might have been one of the ones affected by this change. If you are still interested in contributing your improvement, please fill out the following short form by no later than May 3rd, and we will get back to you with the additional steps necessary once we have had time to assess the PRs of those still interested:

https://forms.gle/V7SrPPMZDo6iGDYu8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skill (Auto labeled)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants