Innopolis University DevOps Playground
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IU_RQ_self_assessment_bot
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kirill Korikov
IU_RQ_self_assessment_bot
Commits
6a53ecb5
Commit
6a53ecb5
authored
3 months ago
by
Saveliy
Browse files
Options
Downloads
Patches
Plain Diff
Bugs with checking GPT generative.
parent
4586f685
Branches
add-gptgener-checking
Branches containing commit
No related tags found
1 merge request
!9
Add GPT generating
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MainTask/Bot/botDef.py
+7
-0
7 additions, 0 deletions
MainTask/Bot/botDef.py
MainTask/PDFModule/QuestionsCheckerAI.py
+7
-6
7 additions, 6 deletions
MainTask/PDFModule/QuestionsCheckerAI.py
MainTask/main.py
+2
-0
2 additions, 0 deletions
MainTask/main.py
with
16 additions
and
6 deletions
MainTask/Bot/botDef.py
+
7
−
0
View file @
6a53ecb5
...
...
@@ -60,10 +60,17 @@ async def gpt_checker_end(update, context):
pdf_file
=
PDF
(
file_path
,
int
(
1
))
pdf_file
.
parsingQuestions
()
ai_checker
=
QuestionsChecker
(
pdf_file
)
res
=
ai_checker
.
gpt_generating_checking
()
os
.
remove
(
file_path
)
print
(
res
)
res
=
int
(
res
)
if
res
==
0
:
await
update
.
message
.
reply_text
(
'
✅ Everything is fine!
'
)
elif
res
==
1
:
...
...
This diff is collapsed.
Click to expand it.
MainTask/PDFModule/QuestionsCheckerAI.py
+
7
−
6
View file @
6a53ecb5
...
...
@@ -15,16 +15,17 @@ class QuestionsChecker:
self
.
model
=
genai
.
GenerativeModel
(
"
gemini-1.5-flash
"
)
def
gpt_generating_checking
(
self
)
->
str
:
question
=
f
"
Check this text for GPT generation:
"
question
=
f
"
Check this text for GPT generation:
\n
"
for
q
in
self
.
_RQ
.
questions
.
keys
():
question
+=
f
'
{
q
}
:
{
self
.
_RQ
.
questions
[
q
]
}
\n
'
question
=
(
"
Output one number in response
"
f
"
: 0, if the text was not generated,
"
f
"
1 if the probability that the text was generated is very small,
"
f
"
2 if the probability that the text was generated is average
"
f
"
, 3, if the text was definitely generated
"
)
question
+=
(
"
Output one number in response
"
f
"
: 0, if the text was not generated,
"
f
"
1 if the probability that the text was generated is very small,
"
f
"
2 if the probability that the text was generated is average
"
f
"
, 3, if the text was definitely generated. in your answer write only one number without any
"
f
"
additional text
"
)
response
=
self
.
model
.
generate_content
(
question
)
...
...
This diff is collapsed.
Click to expand it.
MainTask/main.py
+
2
−
0
View file @
6a53ecb5
...
...
@@ -38,4 +38,6 @@ if __name__ == '__main__':
fallbacks
=
[
CommandHandler
(
'
cancel
'
,
cancel
)]
)
app
.
add_handler
(
conv_handler
)
app
.
run_polling
()
This diff is collapsed.
Click to expand it.
Preview
0%
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