Spaces:
Runtime error
Runtime error
ad
Browse files
ape/__pycache__/__init__.cpython-38.pyc
CHANGED
Binary files a/ape/__pycache__/__init__.cpython-38.pyc and b/ape/__pycache__/__init__.cpython-38.pyc differ
|
|
ape/__pycache__/__init__.cpython-39.pyc
ADDED
Binary file (147 Bytes). View file
|
|
ape/__pycache__/prompt.cpython-38.pyc
CHANGED
Binary files a/ape/__pycache__/prompt.cpython-38.pyc and b/ape/__pycache__/prompt.cpython-38.pyc differ
|
|
ape/__pycache__/prompt.cpython-39.pyc
ADDED
Binary file (599 Bytes). View file
|
|
ape/llm.py
CHANGED
@@ -79,12 +79,16 @@ class LLMGPT(object):
|
|
79 |
score = 0
|
80 |
for sample in eval_set:
|
81 |
output_len = len(LLMGPT.encoding.encode(sample[1]))
|
82 |
-
|
|
|
|
|
83 |
llmresult = eval_chain.generate([{'instruction': instruction, 'input': sample[0], 'output': sample[1]}])
|
84 |
logprobs = llmresult.generations[0][0].generation_info['logprobs']
|
85 |
print(logprobs)
|
86 |
tokens = logprobs['tokens']
|
87 |
print(len(tokens))
|
|
|
|
|
88 |
token_probs = logprobs['token_logprobs']
|
89 |
score += sum(token_probs[-output_len:])
|
90 |
return score
|
|
|
79 |
score = 0
|
80 |
for sample in eval_set:
|
81 |
output_len = len(LLMGPT.encoding.encode(sample[1]))
|
82 |
+
input_len= len(LLMGPT.encoding.encode(sample[0]) + instruction)
|
83 |
+
print('Encoded:',input_len, output_len)
|
84 |
+
print('Raw:', len(sample[1]), len(sample[0] + instruction))
|
85 |
llmresult = eval_chain.generate([{'instruction': instruction, 'input': sample[0], 'output': sample[1]}])
|
86 |
logprobs = llmresult.generations[0][0].generation_info['logprobs']
|
87 |
print(logprobs)
|
88 |
tokens = logprobs['tokens']
|
89 |
print(len(tokens))
|
90 |
+
for i in range(3):
|
91 |
+
print(tokens[i])
|
92 |
token_probs = logprobs['token_logprobs']
|
93 |
score += sum(token_probs[-output_len:])
|
94 |
return score
|