Bikas0 commited on
Commit
42e9bde
1 Parent(s): 964f22a

Update README.md

Browse files

---
title: Answering Bengali Questions using Transformers
license: mit
language:
- bn
pipeline_tag: question-answering
base_model: Bikas0/Bengali-Question-Answer-Llama3
tags:
- code
---

```bash
from transformers import TextStreamer
from unsloth import FastLanguageModel
import torch
alpaca_prompt = """
### Instruction:
{}

### Input:
{}

### Response:
{}"""
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "Bikas0/Bengali-Question-Answer-Llama3", # YOUR MODEL YOU USED FOR TRAINING
max_seq_length = 2048,
dtype = torch.float16,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
inputs = tokenizer(
[
alpaca_prompt.format(
"Please provide a detailed answer to the following question", # instruction
"বাংলা একাডেমি আইন কোন কারণে সদস্যপদ বাতিল করা হবে ?", # input
# সড়ক রক্ষণাবেক্ষণ তহবিল বোর্ড আইন, ২০১৩ অনুযায়ী, তহবিলের উৎসসমূহ কী কী?
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")

text_streamer = TextStreamer(tokenizer)
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 2048)

```

Files changed (1) hide show
  1. README.md +0 -1
README.md CHANGED
@@ -4,7 +4,6 @@ license: mit
4
  language:
5
  - bn
6
  pipeline_tag: question-answering
7
- library_name: adapter-transformers
8
  base_model: Bikas0/Bengali-Question-Answer-Llama3
9
  tags:
10
  - code
 
4
  language:
5
  - bn
6
  pipeline_tag: question-answering
 
7
  base_model: Bikas0/Bengali-Question-Answer-Llama3
8
  tags:
9
  - code