shuvom commited on
Commit
97aec21
·
1 Parent(s): b1073bb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -22
README.md CHANGED
@@ -3,7 +3,7 @@ tags:
3
  - autotrain
4
  - text-generation
5
  widget:
6
- - text: 'I love AutoTrain because '
7
  license: mit
8
  datasets:
9
  - smangrul/hinglish_self_instruct_v0
@@ -20,26 +20,10 @@ This model was trained using AutoTrain. For more information, please visit [Auto
20
 
21
  ```python
22
 
23
- from transformers import AutoModelForCausalLM, AutoTokenizer
 
24
 
25
- model_path = "PATH_TO_THIS_REPO"
26
-
27
- tokenizer = AutoTokenizer.from_pretrained(model_path)
28
- model = AutoModelForCausalLM.from_pretrained(
29
- model_path,
30
- device_map="auto",
31
- torch_dtype='auto'
32
- ).eval()
33
-
34
- # Prompt content: "hi"
35
- messages = [
36
- {"role": "user", "content": "hi"}
37
- ]
38
-
39
- input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
40
- output_ids = model.generate(input_ids.to('cuda'))
41
- response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
42
-
43
- # Model response: "Hello! How can I assist you today?"
44
- print(response)
45
  ```
 
3
  - autotrain
4
  - text-generation
5
  widget:
6
+ - text: 'hi kaise hai app '
7
  license: mit
8
  datasets:
9
  - smangrul/hinglish_self_instruct_v0
 
20
 
21
  ```python
22
 
23
+ from peft import PeftModel, PeftConfig
24
+ from transformers import AutoModelForCausalLM
25
 
26
+ config = PeftConfig.from_pretrained("shuvom/OpenHathi-7B-FT-v0.1_SI")
27
+ model = AutoModelForCausalLM.from_pretrained("sarvamai/OpenHathi-7B-Hi-v0.1-Base")
28
+ model = PeftModel.from_pretrained(model, "shuvom/OpenHathi-7B-FT-v0.1_SI")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  ```