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
cb7be376
Unverified
Commit
cb7be376
authored
Jan 12, 2024
by
Garfield Dai
Committed by
GitHub
Jan 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: huggingface llm add new params. (#2014)
parent
34bf2877
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
1 deletion
+49
-1
llm.py
.../model_runtime/model_providers/huggingface_hub/llm/llm.py
+49
-1
No files found.
api/core/model_runtime/model_providers/huggingface_hub/llm/llm.py
View file @
cb7be376
...
...
@@ -134,7 +134,55 @@ class HuggingfaceHubLargeLanguageModel(_CommonHuggingfaceHub, LargeLanguageModel
precision
=
0
,
)
return
[
temperature_rule
,
top_k_rule
,
top_p_rule
]
max_new_tokens
=
ParameterRule
(
name
=
'max_new_tokens'
,
label
=
{
'en_US'
:
'Max New Tokens'
,
'zh_Hans'
:
'最大新标记'
,
},
type
=
'int'
,
help
=
{
'en_US'
:
'Maximum number of generated tokens.'
,
'zh_Hans'
:
'生成的标记的最大数量。'
,
},
required
=
False
,
default
=
20
,
min
=
1
,
max
=
4096
,
precision
=
0
,
)
seed
=
ParameterRule
(
name
=
'seed'
,
label
=
{
'en_US'
:
'Random sampling seed'
,
'zh_Hans'
:
'随机采样种子'
,
},
type
=
'int'
,
help
=
{
'en_US'
:
'Random sampling seed.'
,
'zh_Hans'
:
'随机采样种子。'
,
},
required
=
False
,
precision
=
0
,
)
repetition_penalty
=
ParameterRule
(
name
=
'repetition_penalty'
,
label
=
{
'en_US'
:
'Repetition Penalty'
,
'zh_Hans'
:
'重复惩罚'
,
},
type
=
'float'
,
help
=
{
'en_US'
:
'The parameter for repetition penalty. 1.0 means no penalty.'
,
'zh_Hans'
:
'重复惩罚的参数。1.0 表示没有惩罚。'
,
},
required
=
False
,
precision
=
1
,
)
return
[
temperature_rule
,
top_k_rule
,
top_p_rule
,
max_new_tokens
,
seed
,
repetition_penalty
]
def
_handle_generate_stream_response
(
self
,
model
:
str
,
...
...
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