anamikac2708
commited on
Commit
•
a5035de
1
Parent(s):
e21c872
Update README.md
Browse files
README.md
CHANGED
@@ -30,7 +30,6 @@ This project is for research purposes only. Third-party datasets may be subject
|
|
30 |
import torch
|
31 |
from unsloth import FastLanguageModel
|
32 |
from transformers import AutoTokenizer, pipeline
|
33 |
-
model_id='FinLang/investopedia_chat_model'
|
34 |
max_seq_length=2048
|
35 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
36 |
model_name = "anamikac2708/Gemma-7b-finetuned-investopedia-Merged-FP16", # YOUR MODEL YOU USED FOR TRAINING
|
@@ -38,7 +37,6 @@ model, tokenizer = FastLanguageModel.from_pretrained(
|
|
38 |
dtype = torch.bfloat16,
|
39 |
#load_in_4bit = True, # IF YOU WANT TO LOAD WITH BITSANDBYTES INT4
|
40 |
)
|
41 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
42 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
43 |
example = [{'content': 'You are a financial expert and you can answer any questions related to finance. You will be given a context and a question. Understand the given context and\n try to answer. Users will ask you questions in English and you will generate answer based on the provided CONTEXT.\n CONTEXT:\n D. in Forced Migration from the University of the Witwatersrand (Wits) in Johannesburg, South Africa; A postgraduate diploma in Folklore & Cultural Studies at Indira Gandhi National Open University (IGNOU) in New Delhi, India; A Masters of International Affairs at Columbia University; A BA from Barnard College at Columbia University\n', 'role': 'system'}, {'content': ' In which universities did the individual obtain their academic qualifications?\n', 'role': 'user'}, {'content': ' University of the Witwatersrand (Wits) in Johannesburg, South Africa; Indira Gandhi National Open University (IGNOU) in New Delhi, India; Columbia University; Barnard College at Columbia University.', 'role': 'assistant'}]
|
44 |
prompt = pipe.tokenizer.apply_chat_template(example[:2], tokenize=False, add_generation_prompt=True)
|
|
|
30 |
import torch
|
31 |
from unsloth import FastLanguageModel
|
32 |
from transformers import AutoTokenizer, pipeline
|
|
|
33 |
max_seq_length=2048
|
34 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
35 |
model_name = "anamikac2708/Gemma-7b-finetuned-investopedia-Merged-FP16", # YOUR MODEL YOU USED FOR TRAINING
|
|
|
37 |
dtype = torch.bfloat16,
|
38 |
#load_in_4bit = True, # IF YOU WANT TO LOAD WITH BITSANDBYTES INT4
|
39 |
)
|
|
|
40 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
41 |
example = [{'content': 'You are a financial expert and you can answer any questions related to finance. You will be given a context and a question. Understand the given context and\n try to answer. Users will ask you questions in English and you will generate answer based on the provided CONTEXT.\n CONTEXT:\n D. in Forced Migration from the University of the Witwatersrand (Wits) in Johannesburg, South Africa; A postgraduate diploma in Folklore & Cultural Studies at Indira Gandhi National Open University (IGNOU) in New Delhi, India; A Masters of International Affairs at Columbia University; A BA from Barnard College at Columbia University\n', 'role': 'system'}, {'content': ' In which universities did the individual obtain their academic qualifications?\n', 'role': 'user'}, {'content': ' University of the Witwatersrand (Wits) in Johannesburg, South Africa; Indira Gandhi National Open University (IGNOU) in New Delhi, India; Columbia University; Barnard College at Columbia University.', 'role': 'assistant'}]
|
42 |
prompt = pipe.tokenizer.apply_chat_template(example[:2], tokenize=False, add_generation_prompt=True)
|