gobean commited on
Commit
fa9f6c8
1 Parent(s): e579b27

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +49 -5
README.md CHANGED
@@ -1,5 +1,49 @@
1
- ---
2
- license: other
3
- license_name: other
4
- license_link: https://huggingface.co/abhishek/autotrain-mixtral-8x7b-orpo-v2
5
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - autotrain
4
+ - text-generation-inference
5
+ - text-generation
6
+ library_name: transformers
7
+ widget:
8
+ - messages:
9
+ - role: user
10
+ content: What is your favorite condiment?
11
+ license: other
12
+ license_name: other
13
+ license_link: https://huggingface.co/abhishek/autotrain-mixtral-8x7b-orpo-v2
14
+ ---
15
+
16
+ gobean: quants at q4_0, q5_0, q8_0 since it's a Mixtral. Manually set EOS due to bug in llama.cpp.
17
+
18
+
19
+ # Model Trained Using AutoTrain
20
+
21
+ This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
22
+
23
+ # Usage
24
+
25
+ ```python
26
+
27
+ from transformers import AutoModelForCausalLM, AutoTokenizer
28
+
29
+ model_path = "PATH_TO_THIS_REPO"
30
+
31
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
32
+ model = AutoModelForCausalLM.from_pretrained(
33
+ model_path,
34
+ device_map="auto",
35
+ torch_dtype='auto'
36
+ ).eval()
37
+
38
+ # Prompt content: "hi"
39
+ messages = [
40
+ {"role": "user", "content": "hi"}
41
+ ]
42
+
43
+ input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
44
+ output_ids = model.generate(input_ids.to('cuda'))
45
+ response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
46
+
47
+ # Model response: "Hello! How can I assist you today?"
48
+ print(response)
49
+ ```