Update README.md
Browse files
README.md
CHANGED
@@ -18,10 +18,10 @@ datasets:
|
|
18 |
Buffala-LoRA is a 7B-parameter LLaMA model finetuned to follow instructions. It is trained on the Stanford Alpaca (TH), WikiTH, Pantip and IAppQ&A dataset and makes use of the Huggingface LLaMA implementation. For more information, please visit [the project's website](https://github.com/tloen/alpaca-lora).
|
19 |
|
20 |
## Issues and what next?
|
21 |
-
- The model still lacks a significant amount of world knowledge, so it is necessary to fine-tune it on larger Thai datasets
|
22 |
-
- Currently, there is no translation prompt. We plan to fine-tune the model on the SCB Thai-English dataset soon.
|
23 |
-
- The model works well with the LangChain Search agent (Serpapi), which serves as a hotfix for world knowledge.
|
24 |
-
|
25 |
|
26 |
## How to use
|
27 |
|
@@ -46,6 +46,30 @@ model = PeftModel.from_pretrained(
|
|
46 |
torch_dtype=torch.float16,
|
47 |
)
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
def evaluate(
|
51 |
instruction,
|
|
|
18 |
Buffala-LoRA is a 7B-parameter LLaMA model finetuned to follow instructions. It is trained on the Stanford Alpaca (TH), WikiTH, Pantip and IAppQ&A dataset and makes use of the Huggingface LLaMA implementation. For more information, please visit [the project's website](https://github.com/tloen/alpaca-lora).
|
19 |
|
20 |
## Issues and what next?
|
21 |
+
- The model still lacks a significant amount of world knowledge, so it is necessary to fine-tune it on larger Thai datasets > Next version: CCNet,OSCAR,Wiki (TH)
|
22 |
+
- Currently, there is no translation prompt. We plan to fine-tune the model on the SCB Thai-English dataset soon.
|
23 |
+
- The model works well with the LangChain Search agent (Serpapi), which serves as a hotfix for world knowledge. > Plan for Spaces with search chain demo
|
24 |
+
- Lacked of chat capabilities, waiting for LangChain implementation.
|
25 |
|
26 |
## How to use
|
27 |
|
|
|
46 |
torch_dtype=torch.float16,
|
47 |
)
|
48 |
|
49 |
+
def generate_prompt(instruction, input=None):
|
50 |
+
|
51 |
+
if input:
|
52 |
+
return f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
53 |
+
### Instruction:
|
54 |
+
{instruction}
|
55 |
+
### Input:
|
56 |
+
{input + get_list_and_snippet(instruction)}
|
57 |
+
### Response:"""
|
58 |
+
else:
|
59 |
+
return f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
60 |
+
### Instruction:
|
61 |
+
{instruction}
|
62 |
+
### Input:
|
63 |
+
{get_list_and_snippet(instruction)}
|
64 |
+
### Response:"""
|
65 |
+
|
66 |
+
if not LOAD_8BIT:
|
67 |
+
model.half() # seems to fix bugs for some users.
|
68 |
+
|
69 |
+
model.eval()
|
70 |
+
if torch.__version__ >= "2" and sys.platform != "win32":
|
71 |
+
model = torch.compile(model)
|
72 |
+
|
73 |
|
74 |
def evaluate(
|
75 |
instruction,
|