Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
4f3053a8
Unverified
Commit
4f3053a8
authored
Aug 22, 2023
by
takatost
Committed by
GitHub
Aug 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: xinference chat completion error (#952)
parent
b3c2bf12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
xinference_llm.py
api/core/third_party/langchain/llms/xinference_llm.py
+2
-2
No files found.
api/core/third_party/langchain/llms/xinference_llm.py
View file @
4f3053a8
...
...
@@ -46,7 +46,7 @@ class XinferenceLLM(Xinference):
return
combined_text_output
else
:
completion
=
model
.
chat
(
prompt
=
prompt
,
generate_config
=
generate_config
)
return
completion
[
"choices"
][
0
][
"
tex
t"
]
return
completion
[
"choices"
][
0
][
"
message"
][
"conten
t"
]
elif
isinstance
(
model
,
RESTfulGenerateModelHandle
):
generate_config
:
"LlamaCppGenerateConfig"
=
kwargs
.
get
(
"generate_config"
,
{})
...
...
@@ -82,7 +82,7 @@ class XinferenceLLM(Xinference):
completion
=
combined_text_output
else
:
completion
=
model
.
chat
(
prompt
=
prompt
,
generate_config
=
generate_config
)
completion
=
completion
[
"choices"
][
0
][
"
tex
t"
]
completion
=
completion
[
"choices"
][
0
][
"
message"
][
"conten
t"
]
if
stop
is
not
None
:
completion
=
enforce_stop_tokens
(
completion
,
stop
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment