Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect format validation, number or array? #25

Open
whatwoot opened this issue Dec 24, 2024 · 7 comments
Open

Incorrect format validation, number or array? #25

whatwoot opened this issue Dec 24, 2024 · 7 comments

Comments

@whatwoot
Copy link

I found that the prompt specifies the format of number:

Your output should strictly conforms the following json format without any additional contents: {"summary_reason": string, "short_memory_index": number, "middle_memory_index": number, "long_memory_index": number, "reflection_memory_index": number}

But array is needed in guardrails?


I was given the following JSON response, which had problems due to incorrect values.

{
"summary_reason": "The decision to invest in TSLA based on the observed price difference from the current to the next trading day is influenced by short-term factors.",
"short_memory_index": -1,
"middle_memory_index": -1,
"long_memory_index": -1,
"reflection_memory_index": -1
}

Help me correct the incorrect values based on the given error messages.

Error Messages:
"JSON does not match schema:\n{\n "$.reflection_memory_index": [\n "-1 is not of type 'array'"\n ],\n "$.long_memory_index": [\n "-1 is not of type 'array'"\n ],\n "$.middle_memory_index": [\n "-1 is not of type 'array'"\n ],\n "$.short_memory_index": [\n "-1 is not of type 'array'"\n ]\n}"

@morning-star-001
Copy link

The generated data for the Fake-Sample-Data is not clear, Do you mind elaborating on how you were able to generate data for use?

A guide for instance on generating tsla.pkl

@Carolyn-Jiang
Copy link
Collaborator

Carolyn-Jiang commented Dec 27, 2024 via email

@morning-star-001
Copy link

thanks for the response..

Got this error

FileNotFoundError: [Errno 2] No such file or directory: './data/05_env_data/env_data.pkl'

Although I created the folder and used the env_data.pkl found in the Fake-Sample-Data, and got another error response:

Ticker list: ------ ['BAC', 'DIS', 'GM', 'MRNA', 'NVDA', 'PFE'] 0%| | 0/496 [00:00<?, ?it/s] Traceback (most recent call last): File "/llm/llm/./data-pipeline/05-get_sentiment_by_ticker.py", line 150, in <module> export_sub_symbol(cur_symbol_lst, senti_model_type = 'FinBERT') File "/llm/llm/./data-pipeline/05-get_sentiment_by_ticker.py", line 132, in export_sub_symbol new_dict, ticker_dict_byDate = subset_symbol_dict(input_dir, cur_symbol_0) File "/llm/llm/./data-pipeline/05-get_sentiment_by_ticker.py", line 28, in subset_symbol_dict cur_filing_q = v[2]['filling_q'] # form q KeyError: 'filling_q'

@morning-star-001
Copy link

The above error has been debugged, been a typo in the env_data.pkl itself In the filling_q key.

A new error did surface though.

Traceback (most recent call last): File "/llm/llm/./data-pipeline/05-get_sentiment_by_ticker.py", line 151, in <module> export_sub_symbol(cur_symbol_lst, senti_model_type = 'FinBERT') File "/llm/llm/./data-pipeline/05-get_sentiment_by_ticker.py", line 137, in export_sub_symbol print('finBERT Date" 2023-05-30: ----- ', new_dict[datetime.date(2023, 5, 30)]['news']) KeyError: datetime.date(2023, 5, 30)

@Carolyn-Jiang
Copy link
Collaborator

Carolyn-Jiang commented Dec 27, 2024 via email

@Carolyn-Jiang
Copy link
Collaborator

Carolyn-Jiang commented Dec 28, 2024 via email

@whatwoot
Copy link
Author

whatwoot commented Jan 2, 2025

@Carolyn-Jiang

Any idea for my question?Thank u a lot!

I found that the prompt specifies the format of number:

Your output should strictly conforms the following json format without any additional contents: {"summary_reason": string, "short_memory_index": number, "middle_memory_index": number, "long_memory_index": number, "reflection_memory_index": number}

But array is needed in guardrails?

I was given the following JSON response, which had problems due to incorrect values.

{ "summary_reason": "The decision to invest in TSLA based on the observed price difference from the current to the next trading day is influenced by short-term factors.", "short_memory_index": -1, "middle_memory_index": -1, "long_memory_index": -1, "reflection_memory_index": -1 }

Help me correct the incorrect values based on the given error messages.

Error Messages: "JSON does not match schema:\n{\n "$.reflection_memory_index": [\n "-1 is not of type 'array'"\n ],\n "$.long_memory_index": [\n "-1 is not of type 'array'"\n ],\n "$.middle_memory_index": [\n "-1 is not of type 'array'"\n ],\n "$.short_memory_index": [\n "-1 is not of type 'array'"\n ]\n}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants