MCPcopy
hub / github.com/zai-org/ChatGLM2-6B / predict

Function predict

web_demo.py:63–71  ·  view source on GitHub ↗
(input, chatbot, max_length, top_p, temperature, history, past_key_values)

Source from the content-addressed store, hash-verified

61
62
63def predict(input, chatbot, max_length, top_p, temperature, history, past_key_values):
64 chatbot.append((parse_text(input), ""))
65 for response, history, past_key_values in model.stream_chat(tokenizer, input, history, past_key_values=past_key_values,
66 return_past_key_values=True,
67 max_length=max_length, top_p=top_p,
68 temperature=temperature):
69 chatbot[-1] = (parse_text(input), parse_text(response))
70
71 yield chatbot, history, past_key_values
72
73
74def reset_user_input():

Callers

nothing calls this directly

Calls 1

parse_textFunction · 0.70

Tested by

no test coverage detected