60 lines
1.7 KiB
Python
Executable File
60 lines
1.7 KiB
Python
Executable File
from aiDataParser import AsyncCore
|
|
from pydantic import BaseModel
|
|
from typing import List
|
|
import time
|
|
import os
|
|
import json
|
|
import orjson
|
|
from pathlib import Path
|
|
|
|
|
|
def load_orjson(path: str | Path):
|
|
path = Path(path)
|
|
with path.open("rb") as f: # باید باینری باز بشه برای orjson
|
|
return orjson.loads(f.read())
|
|
|
|
|
|
def save_orjson(path, data):
|
|
with open(path, "wb") as f:
|
|
f.write(
|
|
orjson.dumps(data, option=orjson.OPT_INDENT_2 | orjson.OPT_NON_STR_KEYS)
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
# start = time.time()
|
|
ruuner = AsyncCore(
|
|
model_name="gemma-3-27b",#"gemma-3-27b" , # "gpt-oss-120b"
|
|
data_path="/home1/ava3/init_mahdi/project/aiDataParser/task/mn_voice/mn_sanad_p2_title.json",
|
|
output_path="/home1/ava3/init_mahdi/project/aiDataParser/task/mn_voice/title_by_heading",
|
|
api_url="http://172.16.29.102:8001/v1/", # "http://172.16.29.102:8001/v1/"
|
|
task_name="mn_voice_summerize", #"gemma-27",
|
|
reasoning_effort="medium",
|
|
ai_code_version="gemma-27b-med",
|
|
request_timeout=600,
|
|
save_number=100,
|
|
semaphore_number=200,
|
|
priority=1,
|
|
max_token=None,
|
|
)
|
|
#
|
|
|
|
# data = [
|
|
# i["user_prompt"]
|
|
# for i in load_orjson(
|
|
# "/home1/ava3/init_mahdi/project/aiDataParser/task/mn_voice/step1.json"
|
|
# )
|
|
# if i["id"] != "pm113897"
|
|
# ]
|
|
ruuner.async_eval()
|
|
# parsed, _ = ruuner.single_simple_async_proccess_item(
|
|
# item={
|
|
# # "system_prompt" :P1,
|
|
# "user_prompt":""""""
|
|
# }
|
|
# )
|
|
# end = time.time()
|
|
# print(f"gemma-3-27b Time {start-end:.2f}s")
|
|
|
|
# python3 -m aiDataParser.task.mn_voice.run_title
|