fix(blogpost): wrong codeblock separate
This commit is contained in:
parent
df9c4d6946
commit
822a11e975
@ -101,6 +101,7 @@ You can create your dataset by using the following example code.
|
|||||||
|
|
||||||
First, we need to define some helper functions to process the raw documents into QnA pairs.
|
First, we need to define some helper functions to process the raw documents into QnA pairs.
|
||||||
|
|
||||||
|
```python title="Define helper functions"
|
||||||
# Reads and returns the content of a file.
|
# Reads and returns the content of a file.
|
||||||
def read_file(filepath):
|
def read_file(filepath):
|
||||||
with open(filepath, 'r', encoding='utf-8') as file:
|
with open(filepath, 'r', encoding='utf-8') as file:
|
||||||
@ -113,7 +114,6 @@ def generate_chatgpt_response(messages, temperature=0.5, model="gpt-3.5-turbo",
|
|||||||
)
|
)
|
||||||
return response['choices'][0]['message']['content']
|
return response['choices'][0]['message']['content']
|
||||||
|
|
||||||
```python title="Define helper functions"
|
|
||||||
# Process Markdown files
|
# Process Markdown files
|
||||||
def process_markdown_file(file_path, markdown_splitter, text_splitter):
|
def process_markdown_file(file_path, markdown_splitter, text_splitter):
|
||||||
with open(file_path, 'r') as file:
|
with open(file_path, 'r') as file:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user