-
Notifications
You must be signed in to change notification settings - Fork 499
Cleaned up non-important warnings from the error list #1111
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
Changes from 2 commits
138f89c
5c9c073
aaba4d9
d335bff
02c882a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,8 +25,6 @@ public class InstructExecutor | |
| private LLamaToken[] _inp_pfx; | ||
| private LLamaToken[] _inp_sfx; | ||
|
|
||
| private ISamplingPipeline? _pipeline; | ||
|
|
||
| /// <summary> | ||
| /// | ||
| /// </summary> | ||
|
|
@@ -72,17 +70,17 @@ public override Task LoadState(ExecutorBaseState data) | |
| if(data is InstructExecutorState state) | ||
| { | ||
| _n_session_consumed = state.ConsumedSessionCount; | ||
| _embed_inps = state.EmbedInps.ToList(); | ||
| _embed_inps = state.EmbedInps!.ToList(); | ||
| _is_prompt_run = state.IsPromptRun; | ||
| _consumedTokensCount = state.ConsumedTokensCount; | ||
| _embeds = state.Embeds.ToList(); | ||
| _last_n_tokens = new FixedSizeQueue<LLamaToken>(state.LastTokensCapacity, state.LastTokens); | ||
| _inp_pfx = state.InputPrefixTokens; | ||
| _inp_sfx = state.InputSuffixTokens; | ||
| _embeds = state.Embeds!.ToList(); | ||
| _last_n_tokens = new FixedSizeQueue<LLamaToken>(state.LastTokensCapacity, state.LastTokens!); | ||
| _inp_pfx = state.InputPrefixTokens!; | ||
| _inp_sfx = state.InputSuffixTokens!; | ||
|
Comment on lines
+73
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do have to say that you just made a lot of suppressing just to ignore the warnings, which might introduce some non indicative
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I may have misunderstood the whole “nullables” concept, but from what I understand, they exist so developers can double check they indeed handle a possible null value properly before implementing it on a new system, and mark with “!” if they indeed did. In reality, those values will NOT be null here based on all current implementations that the engine supports, and it doesn’t support alternative state loading ways in which these can be null. Let me know if you have a different view on the nullables, or if you have an alternative way to propose that handles this — or if you wanna try your hand at it I’d be happy to learn how you’ll handle this! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m thinking more long-term. If the implementation ever changes, or someone modifies the state-loading logic in the future, we might suddenly start seeing NullReferenceExceptions in unexpected places. As for this specific comment context, In general I agree with the inhouse double check approach you mentioned, I just hate to assume something will never happen so I made this comment because that was (almost) the only way you handled this warning across the PR, which made me wonder if a "double check" was made. Thank you for your contribution. |
||
| _n_matching_session_tokens = state.MatchingSessionTokensCount; | ||
| _pastTokensCount = state.PastTokensCount; | ||
| _pathSession = state.SessionFilePath; | ||
| _session_tokens = state.SessionTokens.ToList(); | ||
| _session_tokens = state.SessionTokens!.ToList(); | ||
| } | ||
| else | ||
| { | ||
|
|
@@ -107,7 +105,7 @@ public override async Task LoadState(string filename) | |
| using (var fs = new FileStream(filename, FileMode.Open, FileAccess.Read)) | ||
| { | ||
| var state = await JsonSerializer.DeserializeAsync<InstructExecutorState>(fs); | ||
| await LoadState(state); | ||
| await LoadState(state!); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -224,7 +222,7 @@ protected override async Task InferInternal(IInferenceParams inferenceParams, In | |
| if (!string.IsNullOrEmpty(_pathSession) && args.NeedToSaveSession) | ||
| { | ||
| args.NeedToSaveSession = false; | ||
| SaveSessionFile(_pathSession); | ||
| SaveSessionFile(_pathSession!); | ||
| } | ||
|
|
||
| // Sample with the pipeline | ||
|
|
@@ -266,12 +264,12 @@ public class InstructExecutorState : ExecutorBaseState | |
| /// Instruction prefix tokens. | ||
| /// </summary> | ||
| [JsonPropertyName("inp_pfx")] | ||
| public LLamaToken[] InputPrefixTokens { get; set; } | ||
| public LLamaToken[]? InputPrefixTokens { get; set; } | ||
|
martindevans marked this conversation as resolved.
|
||
| /// <summary> | ||
| /// Instruction suffix tokens. | ||
| /// </summary> | ||
| [JsonPropertyName("inp_sfx")] | ||
| public LLamaToken[] InputSuffixTokens { get; set; } | ||
| public LLamaToken[]? InputSuffixTokens { get; set; } | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.