Update README.md
Browse files
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 |
-
|
|
|
|
|
|
|
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 |
```
|