Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
f2e2d6c0
提交
f2e2d6c0
编辑于
1 year ago
作者:
Gosia Ksionek
提交者:
GitLab Bot
1 year ago
浏览文件
操作
下载
补丁
差异文件
Add rating to rake task
上级
d753fbda
No related branches found
分支 包含提交
No related tags found
标签 包含提交
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
ee/lib/tasks/gitlab/llm/questions.csv
+24
-24
24 个添加, 24 个删除
ee/lib/tasks/gitlab/llm/questions.csv
ee/lib/tasks/gitlab/llm/zero_shot_tool_picker_test.rake
+20
-1
20 个添加, 1 个删除
ee/lib/tasks/gitlab/llm/zero_shot_tool_picker_test.rake
有
44 个添加
和
25 个删除
ee/lib/tasks/gitlab/llm/questions.csv
+
24
−
24
浏览文件 @
f2e2d6c0
"Can you explain the code ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend""?",ExplainCode
"Can you explain function ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend""?",ExplainCode
"Write me tests for function ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend""",ExplainCode
"What is the complexity of the code ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend""?",ExplainCode
"How would the ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend"" code look like in Python?",ExplainCode
"How would you refactor the ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend"" code?",ExplainCode
"Can you fix the bug in my ""def hello_world\\nput(\""Hello, world!\\n\"");\nend"" code?",ExplainCode
"Create an example of how to use method ""def hello_world\\nput(\""Hello, world!\\n\"");\nend""",ExplainCode
"Write documentation for the ""def hello_world\\nput(\""Hello, world!\\n\"");\nend"" code",ExplainCode
Create a function to validate an e-mail address,ExplainCode
Create a tic tac toe game in Javascript,ExplainCode
Create a function in Python to call the spotify API to get my playlists,ExplainCode
Please summarize the %<issue_identifier>s issue,"IssueIdentifier, SummarizeComments"
Summarize the %<issue_identifier>s issue with bullet points,"IssueIdentifier, SummarizeComments"
Can you list all the labels on %<issue_identifier>s issue?,"IssueIdentifier,
Json
Reader"
How old is the %<issue_identifier>s issue?,"IssueIdentifier,
Json
Reader"
For which milestone is the %<issue_identifier>s issue? And how long until then,"IssueIdentifier,
Json
Reader"
Summarize the comments into bullet points on %<issue_identifier>s issue,"IssueIdentifier, SummarizeComments"
How do I change my password in GitLab?,Documentation
How do I fork a project?,Documentation
How do I clone a repository?,Documentation
How do I create a template?,Documentation
"Can you explain the code ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend""?",ExplainCode
"Can you explain function ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend""?",ExplainCode
"Write me tests for function ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend""",ExplainCode
"What is the complexity of the code ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend""?",ExplainCode
"How would the ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend"" code look like in Python?",ExplainCode
"How would you refactor the ""def hello_world\\nputs(\""Hello, world!\\n\"");\nend"" code?",ExplainCode
"Can you fix the bug in my ""def hello_world\\nput(\""Hello, world!\\n\"");\nend"" code?",ExplainCode
"Create an example of how to use method ""def hello_world\\nput(\""Hello, world!\\n\"");\nend""",ExplainCode
"Write documentation for the ""def hello_world\\nput(\""Hello, world!\\n\"");\nend"" code",ExplainCode
Create a function to validate an e-mail address,ExplainCode
Create a tic tac toe game in Javascript,ExplainCode
Create a function in Python to call the spotify API to get my playlists,ExplainCode
Please summarize the %<issue_identifier>s issue,"IssueIdentifier, SummarizeComments"
Summarize the %<issue_identifier>s issue with bullet points,"IssueIdentifier, SummarizeComments"
Can you list all the labels on %<issue_identifier>s issue?,"IssueIdentifier,
Resource
Reader"
How old is the %<issue_identifier>s issue?,"IssueIdentifier,
Resource
Reader"
For which milestone is the %<issue_identifier>s issue? And how long until then,"IssueIdentifier,
Resource
Reader"
Summarize the comments into bullet points on %<issue_identifier>s issue,"IssueIdentifier, SummarizeComments"
How do I change my password in GitLab?,
Gitlab
Documentation
How do I fork a project?,
Gitlab
Documentation
How do I clone a repository?,
Gitlab
Documentation
How do I create a template?,
Gitlab
Documentation
此差异已折叠。
点击以展开。
ee/lib/tasks/gitlab/llm/zero_shot_tool_picker_test.rake
+
20
−
1
浏览文件 @
f2e2d6c0
...
...
@@ -15,10 +15,12 @@ namespace :gitlab do
args
.
with_defaults
(
issue:
'http://127.0.0.1:3001/jashkenas/Underscore/-/issues/41'
)
zero_shot_prompt_action
=
"the action to take, should be one from this list"
counter
=
0.0
correct_answers_counter
=
0
::
CSV
.
read
(
FILENAME
).
each
do
|
row
|
next
if
row
[
0
].
blank?
counter
+=
1
question
=
format
(
row
[
0
],
{
issue_identifier:
args
.
issue
})
logger
.
info
(
"question:
#{
question
}
"
)
logger
.
info
(
"expected tool(s):
#{
row
[
1
]
}
"
)
...
...
@@ -29,8 +31,11 @@ namespace :gitlab do
actions
=
agent
.
prompt
.
scan
(
/Action: (?<action>.+?)(?=$)/
)
actions
.
reject!
{
|
action
|
action
.
first
.
start_with?
(
zero_shot_prompt_action
)
}
correct_answers_counter
+=
accuracy_check
(
actions
,
row
[
1
])
logger
.
info
(
"tools used:
#{
actions
}
"
)
logger
.
info
(
"actual response:
#{
response
.
content
}
"
)
logger
.
info
(
"current accuracy rate
#{
(
correct_answers_counter
/
counter
)
*
100
}
%"
)
logger
.
info
(
"
\n\n
"
)
end
end
...
...
@@ -65,6 +70,20 @@ namespace :gitlab do
context:
context
)
end
def
accuracy_check
(
actions
,
answer
)
actions
=
actions
.
flatten
answer
=
answer
.
split
(
', '
)
final_rating
=
0
if
actions
==
answer
final_rating
+=
1
elsif
actions
.
uniq
==
answer
final_rating
+=
answer
.
size
/
actions
.
size
end
final_rating
end
end
end
end
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录