Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ETProvider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Eppelt
ETProvider
Commits
fa44f525
Commit
fa44f525
authored
1 month ago
by
Jonas Eppelt
Browse files
Options
Downloads
Patches
Plain Diff
bugfix
parent
62fde535
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ChatETProvider.py
+11
-6
11 additions, 6 deletions
ChatETProvider.py
with
11 additions
and
6 deletions
ChatETProvider.py
+
11
−
6
View file @
fa44f525
...
...
@@ -61,13 +61,15 @@ class ChatETProvider(BaseProvider, ChatOllama):
model_id_key
=
"
deepseek-r1:8b
"
model_id_label
=
"
ChatETP
"
models
=
[
"
ChatETP
"
]
persona
=
Persona
(
name
=
"
ChatETP
"
,
avatar_route
=
""
)
#/home/jeppelt/mmda_container/chatetprovider/ETP_en.png")
persona
=
Persona
(
name
=
"
ChatETP
"
,
avatar_route
=
""
)
# /home/jeppelt/mmda_container/chatetprovider/ETP_en.png")
registry
=
True
model
:
str
=
"
deepseek-r1:8b
"
fields
=
[
TextField
(
key
=
"
base_url
"
,
label
=
"
Base API URL (optional)
"
,
format
=
"
text
"
),
]
base_url
=
"
deepthought.etp.kit.edu
"
base_url
:
str
=
"
deepthought.etp.kit.edu
:11434
"
def
get_prompt_template
(
self
,
format
)
->
PromptTemplate
:
...
...
@@ -83,14 +85,16 @@ class ChatETProvider(BaseProvider, ChatOllama):
name
=
self
.
__class__
.
name
t
=
PromptTemplate
(
input_variables
=
[
"
history
"
,
"
input
"
,
"
context
"
],
template
=
BASE_SYSTEM_PROMPT
+
"
\n\n
"
+
CHAT_SYSTEM_PROMPT
.
format
(
provider_name
=
name
)
template
=
BASE_SYSTEM_PROMPT
+
"
\n\n
"
+
CHAT_SYSTEM_PROMPT
.
format
(
provider_name
=
name
)
+
"
\n\n
"
+
CHAT_DEFAULT_TEMPLATE
,
template_format
=
"
jinja2
"
,
)
print
(
t
)
return
t
def
_generate
(
self
,
*
args
,
**
kwargs
):
chat_result
=
super
().
_generate
(
*
args
,
**
kwargs
)
# print(chat_result)
...
...
@@ -98,7 +102,8 @@ class ChatETProvider(BaseProvider, ChatOllama):
# print(str(chat_result))
for
generation
in
chat_result
.
generations
:
# remove all thinking marked by <think> tags
generation
.
text
=
re
.
sub
(
r
'
<think>.*?</think>
'
,
''
,
generation
.
text
,
flags
=
re
.
DOTALL
)
generation
.
text
=
re
.
sub
(
r
"
<think>.*?</think>
"
,
""
,
generation
.
text
,
flags
=
re
.
DOTALL
)
# print(generation.text)
return
chat_result
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment