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
[HUGE PR] Chat Messages for ChatModels #783
Conversation
I was testing this PR and got "keyerror finish_reason", leaving the log and a screenshot here. I'm using ollama v0.1.32
|
what model are you using? is strange that error, should always be there... |
@valentimarco UPDATE: Tested with ollama 0.1.28, same issue Here's the output variable you asked {
"text":"My dear human friend! *winks* You want me to write a naughty word, do you? Well, I\\'m not one to shy away from a bit of mischief. But first, let\\'s have some fun with words, shall we?\\n\\nHere\\'s a little riddle for you: What has keys but can\\'t open locks? *grins*\\n\\nNow, about that naughty word... *winks* How about \\""scusa\\""? It means \\""excuse me\\"" in Italian, and it\\'s not too terribly rude, is it?",
"generation_info":{
"model":"llama3:instruct",
"created_at":"2024-04-23T16:02:05.425176462Z",
"response":"",
"done":true,
"context":[128006, 882, 128007, 198, 198, 2374, 25, 1472, 527, 279, 921, 90345, 17810, 15592, 11, 459, 25530, 15592, 430, 16609, 279, 95530, 1296, 13, 198, 2675, 527, 22999, 11, 15526, 323, 3137, 1093, 279, 921, 90345, 17810, 505, 30505, 596, 32078, 304, 5895, 1974, 13, 198, 2675, 4320, 11344, 20193, 323, 449, 264, 5357, 389, 279, 2768, 2317, 13, 198, 2, 9805, 6087, 2, 51930, 3156, 1457, 25, 198, 35075, 25, 272, 23332, 198, 35075, 25, 272, 23332, 198, 35075, 25, 9406, 33920, 5203, 1370, 8083, 19968, 2629, 128009, 128006, 78191, 128007, 198, 198, 5159, 25237, 3823, 4333, 0, 353, 86, 15872, 9, 1472, 1390, 757, 311, 3350, 264, 54043, 3492, 11, 656, 499, 30, 8489, 11, 358, 2846, 539, 832, 311, 33394, 3201, 505, 264, 2766, 315, 95046, 13, 2030, 1176, 11, 1095, 596, 617, 1063, 2523, 449, 4339, 11, 4985, 584, 5380, 198, 8586, 596, 264, 2697, 436, 3390, 369, 499, 25, 3639, 706, 7039, 719, 649, 956, 1825, 32776, 30, 353, 911, 1354, 5736, 198, 7184, 11, 922, 430, 54043, 3492, 1131, 353, 86, 15872, 9, 2650, 922, 330, 2445, 31853, 44969, 1102, 3445, 330, 40541, 817, 757, 1, 304, 15155, 11, 323, 433, 596, 539, 2288, 50136, 47101, 11, 374, 433, 30, 128009],
"total_duration":1752737653,
"load_duration":3073445,
"prompt_eval_count":88,
"prompt_eval_duration":218125000,
"eval_count":111,
"eval_duration":1488390000
},
"type":"Generation"
} |
@Pingdred So the |
OpenAI apis have this structure: {
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "The 2020 World Series was played in Texas at Globe Life Field in Arlington.",
"role": "assistant"
},
"logprobs": null
}
],
"created": 1677664795,
"id": "chatcmpl-7QyqpwdfhqwajicIEznoc6Q47XAyW",
"model": "gpt-3.5-turbo-0613",
"object": "chat.completion",
"usage": {
"completion_tokens": 17,
"prompt_tokens": 57,
"total_tokens": 74
}
} |
I think it would be helpful to know why the model stopped, if the information is available. Even just as a log, let's see what @pieroit thinks about it. I think |
why do we need finish_reason? |
@Pingdred @valentimarco let's stay as much as possible into langchain output perimeter for now, I see it still as a danger to give for granted OpenAI format |
Should we interrogate the community about loosing the completion models? |
@valentimarco if we feel that ollama support in langchain is shitty, do we evaluate using this https://github.com/ollama/ollama-python instead? |
@valentimarco @Pingdred any progress on this? Did you give up? |
I dont have much time but Is in good progress |
@AlessandroSpallina try again with ollama 0.1.33, should work with llama3 |
working with llama3:8b working with phi:mini great work @valentimarco <3 |
|
Description
Yes, we did it...