-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZtest.py
More file actions
26 lines (19 loc) · 766 Bytes
/
Ztest.py
File metadata and controls
26 lines (19 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from prompting import analyze
from crawler import crawl, rank, gen_embed
from generation import synthesize_audio
import time
if __name__ == "__main__":
start_time = time.time()
crawl_num = 5
art_num = 1
prompt = "I am a Chinese college student that study abroad at USA. I want to build a startup related to AI and doing " \
"research in AI. I am also interest in politics between USA and China. "
category = analyze(prompt)
print(category)
articles = crawl("https://cnn.com", crawl_num)
embed = gen_embed(articles)
select = rank(embed, prompt, art_num)
synthesize_audio(select, prompt)
end_time = time.time()
execution_time = end_time - start_time
print(f"Execution time: {execution_time:.6f} seconds")