Downloads · 30 days
66
0% of all-time downloads
vikash06/mistral_v1
mistral_v1 is a text generation model from vikash06. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This model is trained on experimental basis on a small dataset to assess whether training longer on a smaller dataset has a good performance or not.
Downloads · 30 days
66
0% of all-time downloads
All-time downloads
32.6K
Public
Parameters
7.2B
14.5 GB on disk
Likes
5
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
This model is trained on experimental basis on a small dataset to assess whether training longer on a smaller dataset has a good performance or not.
vikash06/llama-2-7b-small-model--> Finetuned model on llama2
The instruction should be reasonable to ask of a person with general world knowledge and should not require searching. In this task, your prompt should give very specific instructions to follow. Constraints, instructions, guidelines, or requirements all work, and the more of them the better.
The question can be complex and can involve human-level reasoning capabilities, but should not require special knowledge. To create a question for this task include both the text of the question as well as the reference text in the form.
This task asks for opinions and facts about the world at large and does not provide any reference text for consultation.
Please don't ask questions that will require more than 3-5 minutes to answer. To create a question for this task include both the text of the question as well as the reference text in the form.
Everything required to produce an answer (e.g. a list, keywords etc) should be included in the passages. To create a question for this task include both the text of the question as well as the reference text in the form.
In this task the text or list of entities under consideration is contained in the prompt (e.g. there is no reference text.). You can choose any categories for classification you like, the more diverse the better.
The model is intnded for direct use
import torch
import pandas as pd
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("vikash06/llama-2-7b-small-model")
model = AutoModelForCausalLM.from_pretrained("vikash06/llama-2-7b-small-model", torch_dtype=torch.float16, device_map="cuda:0")
print (model)
def generate_training_prompt(instruction,context):
return f"""
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction: {instruction}
### Context:
{context.strip()}
""".strip()
data1 ={"instruction": "When was the first Reading railway station opened?", "context": "Reading railway station is a major transport hub in Reading, Berkshire, England. It is on the northern edge of the town centre, near the main retail and commercial areas and the River Thames, 36 miles (58 km) from London Paddington. The first Reading station was opened on 30 March 1840 as the temporary western terminus of the original line of the Great Western Railway (GWR). Reading is the ninth-busiest station in the UK outside London and the second busiest interchange station outside London with over 3.8 million passengers changing trains at the station annually.", "response": "The first Reading railway station was opened on the 30th of March, 1840.", "category": "closed_qa"}
prompt = generate_training_prompt(data1["instruction"],data1["context"])
input_ids = tokenizer(prompt, return_tensors="pt", truncation=True).input_ids.cuda(0)
outputs = model.generate(input_ids=input_ids, max_new_tokens=128, do_sample=True, top_p=0.9,temperature=0.3)
resp = tokenizer.batch_decode(outputs.detach().cpu().numpy(), skip_special_tokens=True)[0][len(prompt):].split("\n")
resp = [x for x in resp if x!='']
print(resp)
1000 samples were carefully selected from each of the category.
We used the below libraries to finetune the llama2-7b: torch==2.1.0
transformers==4.35.2
peft@git+https://github.com/huggingface/peft.git bitsandbytes==0.41.1 trl @ git+https://github.com/lvwerra/trl.git@34e6948d459540a21f80c5be227fb4da039dd97a
We used batch size 0f 2 on 50 epochs
We performed hellaswag task using evaluation library of EleutherAI: https://github.com/EleutherAI/lm-evaluation-harness
below are the results:

Carbon Emitted: 0.432 kg/kWh Offset: 0% hardware: a6000 48GB(3) hours: 28
Detail writeup coming soon
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 45.85 |
| AI2 Reasoning Challenge (25-Shot) | 47.01 |
| HellaSwag (10-Shot) | 67.58 |
| MMLU (5-Shot) | 48.68 |
| TruthfulQA (0-shot) | 37.53 |
| Winogrande (5-shot) | 64.80 |
| GSM8k (5-shot) | 9.48 |