blob: d6ea059c02a5e943a70a9aeb5dc0b5aa74a3886f (
plain) (
blame)
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
|
from ollama import chat, ChatResponse
from re import sub
from os import listdir, path
model : str = "deepseek-r1:70b"
directory : str = "../results/scraper/mailinglist"
with open("preambel", "r") as file:
preambel = file.read()
for name in listdir(directory):
with open(path.join(directory, name)) as file:
content = preambel + "\n" + file.read()
response : ChatResponse = chat(
model=model, messages=[
{
'role': 'user',
'content': content,
}
]
)
no_think_response : str = sub(r'<think>(.|\n)*</think>\n\n', '', response.message.content)
print(no_think_response)
print("\n")
exit()
|