I am building my first config.yml
file, but I get an error about format of config.yml
.
How can I fix this problem?
I think I get an error about format of tying on YML file.
But I can not fix it.
My config.yml
file:
WORKFLOW:
EXTRACT_SUMMARIZATION:
PROMPT_SUMMARY: """Extracting the timestamps of the goals scored by players in a football match using the commentator's description.\n
The structure of input is:
timestamp => text
timestamp => text
timestamp => text
timestamp => text
The output only consists of timestamps and does not include any text.
Example:
Input:
0:01 => [Applause]
0:04 => Welcome, ladies and gentlemen, to the match between Liverpool and Chelsea.
0:14 => Silva has scored, and the score is 1-0 in favor of Liverpool.
0:20 => So, there has been a foul committed by a Liverpool player.
0:25 => The referee has blown the whistle to end the first half.
0:30 => Chelsea has equalized through Ch.
0:45 => Tr has put Chelsea in the lead.
0:50 => So, the match has...
0:55 => ended, and the victory goes to Chelsea.
Output: 0:14, 0:30, 0:45
This is a incorrect format of output:
0:14 => Silva has scored, and the score is 1-0 in favor of Liverpool.
0:45 => Tr has put Chelsea in the lead.
This is an another incorrect format of output:
0:01 => [Applause]
0:04 => 0:14 => 0:25 =>
Do it for the following text:
Input:
{}
Output:
"""
SCALE_TIME_BEFORE: 6
SCALE_TIME_AFTER: 58
ABSTRACT_SUMMARIZATION:
PROMPT: "Rewrite the following sentences to form a paragraph: {}"
COMBINE_CLIP:
SPEECH_RATE: 130
SUB_VIDEO:
FORCE_DOWNLOAD: True
USE_IMAGEIO: False
I used yaml-validator
If you start out with YAML please follow the official recommended extension for files containing YAML documents: .yaml
, it has been that way for many years.
You should also be weary about online tools for YAML parsing, often they give incorrect feedback of validity of YAML documents, as some use outdated and or incomplet parsers. There is also the confidentiality of the uploaded data you should consider.
If you load your document using my ruamel.yaml
parser, you get this error:
ruamel.yaml.parser.ParserError: while parsing a block mapping
in "<unicode string>", line 3, column 5:
PROMPT_SUMMARY: """Extracting th ...
^ (line: 3)
expected <block end>, but found '<scalar>'
in "<unicode string>", line 3, column 23:
PROMPT_SUMMARY: """Extracting the timestamps of th ...
^ (line: 3)
What is happening is that you try to start a scalar ("Extracting the....
) directly after the empty scalar string ""
which is the value for the key PROMPT_SUMMARY
. YAML doesn't allow two double quoted to concatenate by justaposition, or maybe you are confusing YAML quoted scalars with the Python triple-quoted strings.
You should just use one double quote at the end of a scalar. These can be used for multi-line strings, but please be adviced that newlines in such strings are not preserved, every newline has to be a \n. If you need the newlines to be preserved, use a literal style scalar:
PROMPT_SUMMARY: |
Extracting the timestamps of the goals scored by players in a football match using the commentator's description.\n
The structure of input is:
timestamp => text
timestamp => text
timestamp => text
timestamp => text
The output only consists of timestamps and does not include any text.
Example:
Input:
0:01 => [Applause]
0:04 => Welcome, ladies and gentlemen, to the match between Liverpool and Chelsea.
0:14 => Silva has scored, and the score is 1-0 in favor of Liverpool.
0:20 => So, there has been a foul committed by a Liverpool player.
0:25 => The referee has blown the whistle to end the first half.
0:30 => Chelsea has equalized through Ch.
0:45 => Tr has put Chelsea in the lead.
0:50 => So, the match has...
0:55 => ended, and the victory goes to Chelsea.
Output: 0:14, 0:30, 0:45
This is a incorrect format of output:
0:14 => Silva has scored, and the score is 1-0 in favor of Liverpool.
0:45 => Tr has put Chelsea in the lead.
This is an another incorrect format of output:
0:01 => [Applause]
0:04 => 0:14 => 0:25 =>
Do it for the following text:
Input:
{}
Output:
But in literal style scalars there is no escaping (so \n
is going to be backslash followed by n
).
If the multiple double quotes need to be part of the value, then you can add them to the literal scalar without problem