Views
No views yet

float16{system_prompt}
### Instruction:
{instruction or query}
### Response:
{response}{system_prompt}
### Instruction:
{instruction or query}
### Input:
{input}
### Response:
{response}| Model | Type | Data | Base Model | # Params | Download Links |
|---|---|---|---|---|---|
| MalayaLLM 7B Base #v0.1 | Base model | 12GB | LLaMA 7B | 7B | HF Hub |
| MalayaLLM 7B Instruct #v0.1 | Instruction following model | 52k instructions | MalayaLLM 7B Base | 7B | HF Hub |
| MalayaLLM 7B Instruct #v0.2 | Instruction following model | 52k instructions | MalayaLLM 7B Base | 7B | HF Hub |
| ** Note : MalayaLLM 7B Instruct v0.2 is the latest model. |
| Model | Format | Bits | Download Links |
|---|---|---|---|
| MalayaLLM 7B Instruct #v0.1 | GGUF | Q8_0 | HF Hub |
| MalayaLLM 7B Instruct #v0.2 | GGUF | Q8_0 | HF Hub |
1import os
2import torch
3from transformers import (
4 AutoModelForCausalLM,
5 AutoTokenizer,
6 pipeline,
7)
8model_name = "VishnuPJ/MalayaLLM_7B_Instruct_v0.2"
9print(f"Loading model...")
10# Load base model
11base_model = AutoModelForCausalLM.from_pretrained(
12 model_name,
13 low_cpu_mem_usage=True,
14 return_dict=True,
15 torch_dtype=torch.float16,
16 device_map="auto",
17)
18
19tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
20tokenizer.pad_token = tokenizer.eos_token
21tokenizer.padding_side = "right"
22
23pipe = pipeline(task="text-generation", model=base_model, tokenizer=tokenizer, max_length=200)
24sys_prompt = "ഒരു ടാസ്ക് വിവരിക്കുന്ന ഒരു നിർദ്ദേശം ചുവടെയുണ്ട്. അഭ്യർത്ഥന ശരിയായി പൂർത്തിയാക്കുന്ന ഒരു പ്രതികരണം എഴുതുക."
25
26while True:
27 inst = input("Enter instruction (or 'exit' to end): ")
28 if inst.lower() == 'exit':
29 break
30 # Generate response using the user-provided instruction
31 result = pipe(f"{sys_prompt} ### Instruction: {inst} ### Response:")
32 # Print the generated text
33 print(result[0]['generated_text'])Enter instruction (or 'exit' to end): സൂര്യൻ ഉദിക്കുന്ന ദിശ ഏതെന്നു പറയുക .
ഒരു ടാസ്ക് വിവരിക്കുന്ന ഒരു നിർദ്ദേശം ചുവടെയുണ്ട്. അഭ്യർത്ഥന ശരിയായി പൂർത്തിയാക്കുന്ന ഒരു പ്രതികരണം എഴുതുക. ### Instruction: സൂര്യൻ ഉദിക്കുന്ന ദിശ ഏതെന്നു പറയുക . ### Response: സൂര്യൻ ഉദിക്കുന്ന ദിശ കിഴക്കായിരിക്കും.
Enter instruction (or 'exit' to end): Where does the Sun rise?
ഒരു ടാസ്ക് വിവരിക്കുന്ന ഒരു നിർദ്ദേശം ചുവടെയുണ്ട്. അഭ്യർത്ഥന ശരിയായി പൂർത്തിയാക്കുന്ന ഒരു പ്രതികരണം എഴുതുക. ### Instruction: Where does the Sun rise? ### Response: The Sun rises in the east.
Enter instruction (or 'exit' to end):