
# ibleducation/ibl-tutoring-7B-128k 
ibleducation/ibl-tutoring-7B-128k  is a model finetuned on top of openchat/openchat_3.5

This model is finetuned to give responses in a way befitting of a professional teacher. 
It is finetuned to exhibit characteristics and virtues such as compassion, encouragement, friendliness and more.


## Example Conversations
1. Question:  What is the formula for calculating the area of a triangle?? \
   Answer:
   ```code
   Excellent question! The formula for calculating the area of a triangle is 1/2 times the base times the height. Remember, the base is the length of the bottom side, and the height is the perpendicular distance from the base to the opposite vertex. Let's work through an example together!
   ```
   
2. Question: Can you explain the concept of gravity? \
   Answer:
   ```code
   Certainly! Gravity is the force that attracts objects towards each other. It's what keeps us grounded on Earth. Would you like me to give you some examples to help you understand it better?
   ```



## Model Details

- **Developed by:** [IBL Education](https://ibl.ai)
- **Model type:** [Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
- **Base Model:** [NousResearch/Yarn-Mistral-7b-128k](https://huggingface.co/NousResearch/Yarn-Mistral-7b-128k)
- **Language:** English
- **Finetuned from weights:** [NousResearch/Yarn-Mistral-7b-128k](https://huggingface.co/NousResearch/Yarn-Mistral-7b-128k)
- **Finetuned on data:**
  - ibl-best-practices-instructor-dataset (private)
- **Model License:** Apache 2.0

## How to Get Started with the Model

### Install the necessary packages

Requires: [transformers](https://pypi.org/project/transformers/) 4.35.0 or later, flash_attn and [accelerate](https://pypi.org/project/accelerate/) 0.23.0 or later.

```shell
pip install transformers==4.35.0
pip install accelerate==0.23.0
pip install flash_attn
```
### You can then try the following example code

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import transformers
import torch

model_id = "ibleducation/ibl-tutoring-7B-128k"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
  model_id,
  use_flash_attention_2=True,
  torch_dtype=torch.bfloat16,
  device_map="auto",
  trust_remote_code=True
)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
)
prompt = "<s>What makes a good teacher?</s>"

response = pipeline(prompt)
print(response['generated_text'])
```

> In cases where the runtime gpu does not support flash attention, `use_flash_attention_2` can be ignored
> though at a possible performance cost

**Important** - Use the prompt template below for ibl-tutoring-7B-128k :
```
<s>{prompt}</s>
```




{}
transformers safetensors mistral text-generation custom_code autotrain_compatible endpoints_compatible text-generation-inference region:us