Ashishkr commited on
Commit
ce69aab
1 Parent(s): 9bcd97e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -2
README.md CHANGED
@@ -18,7 +18,7 @@ from peft import PeftModel, PeftConfig
18
  from transformers import AutoModelForCausalLM
19
  from transformers import AutoTokenizer
20
  import torch
21
-
22
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
23
 
24
  config = PeftConfig.from_pretrained("Ashishkr/llama2-qrecc-context-resolution")
@@ -70,7 +70,11 @@ response = response_generate(
70
  temperature=0.1,
71
  )
72
 
73
- print(response)
 
 
 
74
 
 
75
 
76
  ```
 
18
  from transformers import AutoModelForCausalLM
19
  from transformers import AutoTokenizer
20
  import torch
21
+ import re
22
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
23
 
24
  config = PeftConfig.from_pretrained("Ashishkr/llama2-qrecc-context-resolution")
 
70
  temperature=0.1,
71
  )
72
 
73
+ def extract_between_tags(input_string):
74
+ pattern = r'>>REWRITE<<(.*?)</REWRITE>'
75
+ match = re.search(pattern, input_string)
76
+ return match.group(1) if match else ''
77
 
78
+ print(extract_between_tags(response))
79
 
80
  ```