Conversation
| Alternatively, you can use `runInference`. It provides direct access to the model, without any wrapper, so the input string is passed straight into the model. If you're not sure what are implications of that, you're better off with `sendMessage` | ||
| Alternatively, you can use `generate` method. It allows you to simply pass chat messages and receive completion from the model. It doesn't provide any message history management. | ||
|
|
||
| If you need raw model, without any wrappers, you can use `forward`. It provides direct access to the model, so the input string is passed straight into the model. It may be useful to work with models that aren't finetuned for chat completions. If you're not sure what are implications of that, you're better off with `sendMessage` |
There was a problem hiding this comment.
| If you need raw model, without any wrappers, you can use `forward`. It provides direct access to the model, so the input string is passed straight into the model. It may be useful to work with models that aren't finetuned for chat completions. If you're not sure what are implications of that, you're better off with `sendMessage` | |
| If you need raw model, without any wrappers, you can use `forward`. It provides direct access to the model, so the input string is passed straight into the model. It may be useful to work with models that aren't finetuned for chat completions. If you're not sure what are implications of that, you're better off with `sendMessage`. |
There was a problem hiding this comment.
I think you can mention here that you need to add special tokens to make it work
| import { View, StyleSheet, Text } from 'react-native'; | ||
|
|
||
| enum ModelType { | ||
| enum ModeType { |
There was a problem hiding this comment.
Maybe just Mode instead of ModeType
| this.responseCallback(''); | ||
| this.isGeneratingCallback(true); | ||
| await this.nativeModule.runInference(input); | ||
| console.log('INPUT:', input); |
There was a problem hiding this comment.
Remove console.log
|
Can you also bump huggingface/jinja to newest version(0.5.0), as the current has problems with qwen 3 tokenizer. |
There was a problem hiding this comment.
I believe that this is wrong, you're supposed to pass all the special tokens to forward(), but the above prompt definition doesn't do that. Change the call of this method to generate() (not sure if this one is ok)
| Alternatively, you can use `runInference`. It provides direct access to the model, without any wrapper, so the input string is passed straight into the model. If you're not sure what are implications of that, you're better off with `sendMessage` | ||
| Alternatively, you can use `generate` method. It allows you to simply pass chat messages and receive completion from the model. It doesn't provide any message history management. | ||
|
|
||
| If you need raw model, without any wrappers, you can use `forward`. It provides direct access to the model, so the input string is passed straight into the model. It may be useful to work with models that aren't finetuned for chat completions. If you're not sure what are implications of that, you're better off with `sendMessage` |
There was a problem hiding this comment.
I think you can mention here that you need to add special tokens to make it work
| messages: Message[], | ||
| tokenizerConfig: any, | ||
| tools?: LLMTool[], | ||
| template_flags?: Object |
There was a problem hiding this comment.
Can you make template_flags camel case?
There was a problem hiding this comment.
Sorry, missed it, maybe we should enforce camel case with eslint? Can you create issue for it?
Added generate function, and some little re…formats
Type of change
Tested on
Related issues
#226
Checklist