sarvam-user
commited on
Commit
•
158ab09
1
Parent(s):
c3e53bc
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: llama2
|
3 |
+
language:
|
4 |
+
- hi
|
5 |
+
---
|
6 |
+
OpenHathi
|
7 |
+
This repository is the first model in the OpenHathi series of models that will be released by Sarvam AI. This is a 7B parameter, based on Llama2, trained on Hindi, English, and Hinglish. More details about the model, its training procedure, and evaluations can be found here.
|
8 |
+
|
9 |
+
Note: this is a base model and not meant to be used as is. We recommend first finetuning it on task(s) you are interested in.
|
10 |
+
|
11 |
+
```
|
12 |
+
Usage
|
13 |
+
tokenizer = AutoTokenizer.from_pretrained('sarvamai/OpenHathi-7B-Hi-v0.1-Base')
|
14 |
+
model = LlamaForCausalLM.from_pretrained('sarvamai/OpenHathi-7B-Hi-v0.1-Base', torch_dtype=torch.bfloat16)
|
15 |
+
|
16 |
+
prompt = "मैं एक अच्छा हाथी हूँ"
|
17 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
18 |
+
|
19 |
+
# Generate
|
20 |
+
generate_ids = model.generate(inputs.input_ids, max_length=30)
|
21 |
+
tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
22 |
+
```
|