Update maker.py
Browse files
maker.py
CHANGED
@@ -97,19 +97,19 @@ def extract_title_prompt_example(text, title, system_prompt, example_input):
|
|
97 |
prompt_start = -1
|
98 |
example_start = -1
|
99 |
try:
|
100 |
-
title_start = text.lower().rfind("
|
101 |
-
prompt_start = text.lower().rfind("
|
102 |
title = text[title_start:prompt_start].strip()
|
103 |
except ValueError:
|
104 |
pass
|
105 |
try:
|
106 |
-
prompt_start = text.lower().rfind("
|
107 |
-
example_start = text.lower().rfind("
|
108 |
system_prompt = text[prompt_start:example_start].strip()
|
109 |
except ValueError:
|
110 |
pass
|
111 |
try:
|
112 |
-
example_start = text.lower().rfind("
|
113 |
example_input = text[example_start:].strip()
|
114 |
example_input = example_input[:example_input.index("\n")]
|
115 |
except ValueError:
|
|
|
97 |
prompt_start = -1
|
98 |
example_start = -1
|
99 |
try:
|
100 |
+
title_start = text.lower().rfind("Title:") + len("Title:")
|
101 |
+
prompt_start = text.lower().rfind("System prompt:")
|
102 |
title = text[title_start:prompt_start].strip()
|
103 |
except ValueError:
|
104 |
pass
|
105 |
try:
|
106 |
+
prompt_start = text.lower().rfind("System prompt:") + len("System prompt:")
|
107 |
+
example_start = text.lower().rfind("Example input:")
|
108 |
system_prompt = text[prompt_start:example_start].strip()
|
109 |
except ValueError:
|
110 |
pass
|
111 |
try:
|
112 |
+
example_start = text.lower().rfind("Example input:") + len("Example input:")
|
113 |
example_input = text[example_start:].strip()
|
114 |
example_input = example_input[:example_input.index("\n")]
|
115 |
except ValueError:
|