asif00 commited on
Commit
7303625
·
verified ·
1 Parent(s): 2f686d3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -77
README.md CHANGED
@@ -10,80 +10,3 @@ tags:
10
  - gguf
11
  base_model: unsloth/llama-3-8b-bnb-4bit
12
  ---
13
-
14
- This model is a GUFF version of Llama 3 8B, a specialized model for context-based question answering and Bengali retrieval augment generation. It is derived from LLaMA 3 8B and trained on the iamshnoo/alpaca-cleaned-bengali dataset. This model is designed to provide accurate responses in Bengali with relevant contextual information. It is integrated with the transformers library, making it easy to use for context-based question answering and Bengali retrieval augment generation in projects.
15
-
16
- # Model Details:
17
-
18
- - Model Family: Llama 3 8B
19
- - Language: Bengali
20
- - Use Case: Context-Based Question Answering, Bengali Retrieval Augment Generation
21
- - Dataset: iamshnoo/alpaca-cleaned-bengali (51,760 samples)
22
- - Training Loss: 0.4038
23
- - Global Steps: 647
24
- - Batch Size: 80
25
- - Epoch: 1
26
-
27
-
28
- # How to Use:
29
-
30
- You can use the model with a pipeline for a high-level helper or load the model directly. Here's how:
31
-
32
- ```python
33
- # Use a pipeline as a high-level helper
34
- from transformers import pipeline
35
- pipe = pipeline("question-answering", model="asif00/bangla-llama-4bit")
36
- ```
37
-
38
- ```python
39
- # Load model directly
40
- from transformers import AutoTokenizer, AutoModelForCausalLM
41
- tokenizer = AutoTokenizer.from_pretrained("asif00/bangla-llama-4bit")
42
- model = AutoModelForCausalLM.from_pretrained("asif00/bangla-llama-4bit")
43
- ```
44
-
45
- # General Prompt Structure:
46
-
47
- ```python
48
- prompt = """Below is an instruction in Bengali language that describes a task, paired with an input also in Bengali language that provides further context. Write a response in Bengali language that appropriately completes the request.
49
-
50
- ### Instruction:
51
- {}
52
-
53
- ### Input:
54
- {}
55
-
56
- ### Response:
57
- {}
58
- """
59
- ```
60
-
61
- # To get a cleaned up version of the response, you can use the `generate_response` function:
62
-
63
- ```python
64
- def generate_response(question, context):
65
- inputs = tokenizer([prompt.format(question, context, "")], return_tensors="pt").to("cuda")
66
- outputs = model.generate(**inputs, max_new_tokens=1024, use_cache=True)
67
- responses = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
68
- response_start = responses.find("### Response:") + len("### Response:")
69
- response = responses[response_start:].strip()
70
- return response
71
- ```
72
-
73
- # Example Usage:
74
-
75
- ```python
76
- question = "ভারতীয় বাঙালি কথাসাহিত্যিক মহাশ্বেতা দেবীর মৃত্যু কবে হয় ?"
77
- context = "২০১৬ সালের ২৩ জুলাই হৃদরোগে আক্রান্ত হয়ে মহাশ্বেতা দেবী কলকাতার বেল ভিউ ক্লিনিকে ভর্তি হন। সেই বছরই ২৮ জুলাই একাধিক অঙ্গ বিকল হয়ে তাঁর মৃত্যু ঘটে। তিনি মধুমেহ, সেপ্টিসেমিয়া ও মূত্র সংক্রমণ রোগেও ভুগছিলেন।"
78
- answer = generate_response(question, context)
79
- print(answer)
80
- ```
81
-
82
-
83
- # Disclaimer:
84
-
85
- The Bangla LLaMA-4bit model has been trained on a limited dataset, and its responses may not always be perfect or accurate. The model's performance is dependent on the quality and quantity of the data it has been trained on. Given more resources, such as high-quality data and longer training time, the model's performance can be significantly improved.
86
-
87
-
88
- # Resources:
89
- Work in progress...
 
10
  - gguf
11
  base_model: unsloth/llama-3-8b-bnb-4bit
12
  ---