feat: 更新翻译模型
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:
This commit is contained in:
@@ -7,9 +7,9 @@ class SAMRequestModel(BaseModel):
|
|||||||
user_id: int = Field(..., description="用户id, 必填字段")
|
user_id: int = Field(..., description="用户id, 必填字段")
|
||||||
image_path: str = Field(..., description="图片路径,必填字段")
|
image_path: str = Field(..., description="图片路径,必填字段")
|
||||||
type: str = Field(..., description="推理类型,必填字段")
|
type: str = Field(..., description="推理类型,必填字段")
|
||||||
points: Optional[List[List[float]]] = None
|
points: Optional[List[List[float]]] | None = None
|
||||||
labels: Optional[List[int]] = None
|
labels: Optional[List[int]] | None = None
|
||||||
box: Optional[List[int]] = None
|
box: Optional[List[int]] | None = None
|
||||||
|
|
||||||
|
|
||||||
class DesignModel(BaseModel):
|
class DesignModel(BaseModel):
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ def get_response(messages):
|
|||||||
|
|
||||||
def get_translation_from_llama3(text):
|
def get_translation_from_llama3(text):
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
url = f"http://{settings.A6000_SERVICE_HOST}:11434/api/generate"
|
url = f"http://{settings.A6000_SERVICE_HOST}:12434/api/generate"
|
||||||
# url = "http://10.1.1.240:1143/api/generate"
|
# url = "http://10.1.1.240:1143/api/generate"
|
||||||
|
|
||||||
# prompt = f"System: {prefix_for_llama}\nUser:[{text}]"
|
# prompt = f"System: {prefix_for_llama}\nUser:[{text}]"
|
||||||
@@ -103,8 +103,8 @@ def get_translation_from_llama3(text):
|
|||||||
|
|
||||||
# 创建请求的负载 translator是自定义的翻译模型
|
# 创建请求的负载 translator是自定义的翻译模型
|
||||||
payload = {
|
payload = {
|
||||||
"model": "translator",
|
"model": "AiDA-translator:latest",
|
||||||
"prompt": f"[{text}]",
|
"prompt": text,
|
||||||
"stream": False
|
"stream": False
|
||||||
}
|
}
|
||||||
# 将负载转换为 JSON 格式
|
# 将负载转换为 JSON 格式
|
||||||
@@ -180,7 +180,7 @@ def get_prompt_from_image(image_path, text):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main function"""
|
"""Main function"""
|
||||||
text = get_translation_from_llama3("[火焰]")
|
text = get_translation_from_llama3("火焰")
|
||||||
print(text)
|
print(text)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user