MCPcopy Create free account
hub / github.com/Felixgithub2017/MMCU / plain_chat

Function plain_chat

TestMOSS.py:71–76  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

69
70# MOSS
71def plain_chat(query):
72 query = "<|Human|>: "+query+"<eoh>\n<|MOSS|>:"
73 inputs = tokenizer(query, return_tensors="pt")
74 outputs = model.generate(**inputs, do_sample=True, temperature=0.7, top_p=0.8, repetition_penalty=1.1, max_new_tokens=128)
75 response = tokenizer.decode(outputs[0])
76 return response[len(query)+2:].replace("<eom>","").strip().rstrip()
77
78def read_file_lines(file):
79 with open(file, 'r', errors='ignore', encoding='utf8') as f:

Callers 1

evalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected