ambrosfitz commited on
Commit
8c97b18
·
verified ·
1 Parent(s): 3a5565e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -37
README.md CHANGED
@@ -5,41 +5,4 @@ tags:
5
  - text-generation
6
  - peft
7
  library_name: transformers
8
- widget:
9
- - messages:
10
- - role: user
11
- content: What is your favorite condiment?
12
  license: other
13
- ---
14
-
15
- # Model Trained Using AutoTrain
16
-
17
- This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
18
-
19
- # Usage
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
- ```
 
5
  - text-generation
6
  - peft
7
  library_name: transformers
 
 
 
 
8
  license: other