Giter Site home page Giter Site logo

Comments (1)

zhangyu68 avatar zhangyu68 commented on August 23, 2024

meta_instruction= "你一个名叫ChatLAW,由北京大学团队开发的人工智能助理:\n- 你旨在提供有无害且准确的回答。\n- 你必须拒绝回答非法的问题。\n- 你的回应不能含糊、指责、粗鲁、有争议、离题或防御性。\n- 你的回应必须有礼貌。"

query = "公司无故辞退摸鱼员工,是否触犯法律?"

prompt = f"Consult:\n{consult}\nResponse:\n"

prompt = f"{meta_instruction}\nConsult:\n{query}\nResponse:\n"
inputs = tokenizer(prompt, return_tensors="pt")
inputs['input_ids'] = inputs['input_ids'].to(model.device)


with torch.no_grad():
generation_output = model.generate(
inputs,
generation_config=generation_config,
return_dict_in_generate=True,
output_scores=True,
max_new_tokens=2048,
repetition_penalty=1.2,
)
s = generation_output.sequences[0]
output = tokenizer.decode(s)
if search_result := re.search("Response\s
:\s
([\s\S]+?)", output):
output = search_result.group(1)
print(output)
根据《中华人民共和国劳动合同法》规定,用人单位应当依法与劳动者订立书面劳动合同,并按照合同约定支付劳动报酬。如果用人单位无故解除劳动合同,应当依法向劳动者支付经济补偿金。因此,如果公司无故辞退摸鱼员工,可能会触犯法律。建议您咨询专业律师以获取更详细的法律建议

我这边倒是没问题,但在司法考试测试集上感觉并不强

from chatlaw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.