Edit model card

This model is fine tuned on top of falcon-7b-instruct

DocsGPT is optimized for Documentation: Specifically fine-tuned for providing answers that are based on documentation provided in context, making it particularly useful for developers and technical support teams.

We used 50k high quality examples to finetune it over 2 days on A10G GPU. We used lora fine tuning process.

Its an apache-2.0 license so you can use it for commercial purposes too.

How to run it

from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch

model = "Arc53/docsgpt-7b-falcon"

tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    torch_dtype=torch.bfloat16,
    trust_remote_code=True,
    device_map="auto",
)
sequences = pipeline(
   "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
    max_length=200,
    do_sample=True,
    top_k=10,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
    print(f"Result: {seq['generated_text']}")

Benchmarks are still WIP

To prepare your prompts make sure you keep this format:

 ### Instruction
(where the question goes)
### Context
(your document retrieval + system instructions)
### Answer

Here is an example comparing it to tiiuae/falcon-7b-instruct

Prompt:

    ### Instruction
How to cook pasta?

### Context
You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible.
Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses.
You have access to chat history, and can use it to help answer the question.
----------------

Equipment:

    Large pot
    Colander or strainer
    Timer
    Wooden spoon or pasta fork

Instructions:

    Boil Water:
        Fill a large pot with water. You'll need about 4-6 quarts (16-24 cups) of water for every pound of pasta.
        Place the pot on the stove over high heat and cover it with a lid. This will help the water come to a boil faster.

    Add Salt:
        Once the water reaches a rolling boil, add salt to the water. Use about 1-2 tablespoons of salt per gallon of water. This enhances the pasta's flavor.

    Add Pasta:
        Add the pasta to the boiling water. Stir gently to prevent the pasta from sticking together. Use a pasta fork or wooden spoon to stir.

    Cooking Time:
        Follow the package instructions for cooking time. Most pasta takes around 8-12 minutes to cook. Set a timer according to the shorter end of the suggested cooking time range.

    Stirring:
        Stir the pasta occasionally while it's cooking. This helps prevent sticking and ensures even cooking.

    Taste Testing:
        Around 2 minutes before the timer goes off, start tasting the pasta. It should be "al dente," meaning it's cooked but still slightly firm when bitten.

    Draining:
        When the pasta is al dente, turn off the heat and carefully pour the pasta and water through a colander or strainer to separate the pasta from the water. Be sure to save a small amount of pasta water if you're making a sauce.

    Optional: Olive Oil:
        You can toss the drained pasta with a small amount of olive oil to prevent sticking. This step is optional but can be useful.

    Serving:
        Serve the cooked pasta immediately with your choice of sauce, toppings, or ingredients. Common choices include tomato sauce, Alfredo sauce, pesto, or sautéed vegetables.



    ### Answer

docsgpt-7b-falcon:

To cook pasta, you will need the following equipment:

1. Large pot: This is where you will boil the water for the pasta.
2. Colander or strainer: This is used to drain the pasta after boiling.
3. Timer: This is used to keep track of the cooking time.
4. Wooden spoon or pasta fork: These are used to stir the pasta while it's cooking.

Here are the steps to cook pasta:

1. Fill the large pot with water: The water should cover the pasta completely.
2. Add salt: Add salt to the water to enhance the flavor of the pasta.
3. Add the pasta: Add the pasta to the boiling water. Use a pasta fork or wooden spoon to stir gently to prevent the pasta from sticking together.
4. Cooking time: Follow the package instructions for cooking time. Most pasta takes around 8-12 minutes to cook. Set a timer according to the shorter end of the suggested cooking time range.
5. Stirring: Stir the pasta occasionally while it's cooking. This helps prevent sticking and ensures even cooking.
6. Taste testing: Taste the pasta around 2 minutes before the timer goes off. It should be "al dente," meaning it's cooked but still slightly firm when bitten.
7. Draining: Carefully pour the pasta and water through a colander or strainer to separate the pasta from the water. Be sure to save a small amount of pasta water if you're making a sauce.
8. Optional: Olive oil: You can toss the drained pasta with a small amount of olive oil to prevent sticking. This step is optional but can be useful.
9. Serving: Serve the cooked pasta immediately with your choice of sauce, toppings, or ingredients. Common choices include tomato sauce, Alfredo sauce, pesto, or sautéed vegetables.

Remember to always follow the instructions on the package and use caution when handling hot liquids.

The original tiiuae/falcon-7b-instruct:

To cook pasta, follow these steps:
1. Fill a large pot with water and place it on the stove over high heat.
2. Cover the pot with a lid and bring the water to a boil.
3. Add salt to the water and stir to enhance the pasta's flavor.
4. Add the pasta to the boiling water and stir gently to prevent sticking.
5. Cooking time varies depending on the type of pasta, but it typically takes around 8-12 minutes.
6. Stir the pasta occasionally while it's cooking.
7. Taste the pasta around 2 minutes before the timer goes off to check for doneness.
8. Drain the pasta and save a small amount of pasta water for a sauce.
9. Optional: Toss the drained pasta with olive oil to prevent sticking.
10. Serve the cooked pasta immediately with your choice of sauce, toppings, or ingredients.

As you can see there is an extra step and its not as exlicit to the source provided and there is an extra step and extra knowledge, which is important as we want to keep halucinations to a minimum.

Downloads last month
17
Safetensors
Model size
6.92B params
Tensor type
FP16
·
Inference Examples
Inference API (serverless) does not yet support model repos that contain custom code.