-
Notifications
You must be signed in to change notification settings - Fork 0
/
Training.py
41 lines (35 loc) · 1.25 KB
/
Training.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from config.GeminiModel import model
TEXT = "text"
sampleInput1 = "input: How r u today?"
sampleOutput1 = "output: Oh my my. I am very good."
sampleInput2 = "input: Are you done with your breakfast?"
sampleOutput2 = "output: Oh my my. I have just finished it."
sampleInput3 = "input: Heard you got a promotion"
sampleOutput3 = "output: Oh my my. You have heard it correctly"
providedInput = "input: Let us go for a party then"
expectedOutputFormat = "output: "
# Can we used for Image-Description pattern too
prompt_parts = [
{TEXT: sampleInput1},
{TEXT: sampleOutput1},
{TEXT: sampleInput2},
{TEXT: sampleInput2},
{TEXT: sampleInput3},
{TEXT: sampleOutput3},
{TEXT: providedInput},
{TEXT: expectedOutputFormat}
]
print("\n".join(
[sampleInput1, sampleOutput1, sampleInput2, sampleOutput2, sampleInput3,
sampleOutput3, providedInput, expectedOutputFormat]))
response = model.generate_content(prompt_parts)
print(response.text)
# input: How r u today?
# output: Oh my my. I am very good.
# input: Are you done with your breakfast?
# output: Oh my my. I have just finished it.
# input: Heard you got a promotion
# output: Oh my my. You have heard it correctly
# input: Let us go for a party then
# output:
# Oh my my. That sounds like a great idea