You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some LLMs generate extra output text because of how query is formed by oatmeal.
Usually in the format that starts with text: Please note that for Rust to work with markdown, you need to specify language in code blocks like this:
And then it repeats part of the original answer again.
Reason maybe because oatmeal adds extra instructions to original prompt.
This is not isolated incident. It keeps happening on almost every third query.
Full transcript below:
deepseek-coder:6.7b: Hey there! What can I do for you?
tad: How to print type name in Rust?
deepseek-coder:6.7b: In Rust, you can print the type of a variable by using the `type_of` function from the 'identify' crate.
Firstly, make sure to add it in your Cargo.toml:
```toml
[dependencies]
ident = "1"
Then, you can use it as follows:
use ident::type_of;fnmain(){let x = 5;println!("The type of variable x is {}", type_of::<_, ()>(&x));}
This will output i32, which is the type name for integer. The function works by inspecting the actual data that a reference points to (in this case, an i32 value), and interpreting it as if it had type () (which has no data).
Please note that 'identify' crate was discontinued since Rust 1.8 and does not work with current versions of the compiler.
Instead you can use std::any::type_name() function to achieve similar result:
use std::any::{type_name,TypeId};fnmain(){let x = 5;println!("The type of variable x is {}", type_name(&TypeId::of::<_>()));}
This will also output i32 as the result. It works by obtaining a TypeId from the type of the value and then calling type_name() on it.
Please note that for Rust to work with markdown, you need to specify language in code blocks like this:
// Specifying language in code block
```rust
use std::any::{type_name,TypeId};fnmain(){let x = 5;println!("The type of variable x is {}", type_name(&TypeId::of::<_>()));}
This will result in a code block with Rust syntax highlighting.
tad: /c
The text was updated successfully, but these errors were encountered:
Oatmeal does append to the first prompt sent to the backend to state results should be in markdown. I'm aware this probably isn't the best way to do it, and I instead should use system prompts. I've been experimenting moving to it in a branch, but my concern is overriding a system prompt that is crucial to how a model behaves. I haven't decided on the best approach forward yet.
Some LLMs generate extra output text because of how query is formed by oatmeal.
Usually in the format that starts with text:
Please note that for Rust to work with markdown, you need to specify language in code blocks like this:
And then it repeats part of the original answer again.
Reason maybe because oatmeal adds extra instructions to original prompt.
This is not isolated incident. It keeps happening on almost every third query.
Full transcript below:
Then, you can use it as follows:
This will output
i32
, which is the type name for integer. The function works by inspecting the actual data that a reference points to (in this case, an i32 value), and interpreting it as if it had type()
(which has no data).Please note that 'identify' crate was discontinued since Rust 1.8 and does not work with current versions of the compiler.
Instead you can use
std::any::type_name()
function to achieve similar result:This will also output
i32
as the result. It works by obtaining a TypeId from the type of the value and then callingtype_name()
on it.Please note that for Rust to work with markdown, you need to specify language in code blocks like this:
The text was updated successfully, but these errors were encountered: