Spaces:
Paused
Paused
Update agent.py
Browse files29 unmodified lines30313233343536373839404117 unmodified lines5960616263646533 unmodified lines9910010110210310410529 unmodified linesTASK_PROMPT = "task prompt"UNDERSTAND_TEST_RESULTS_PROMPT = "understand test results prompt"def format_prompt(message, history):prompt = "\n### Instruction:\n{}\n### History:\n{}".format(message, '\n'.join(history))return promptdef run_agent(instruction, history):prompt = format_prompt(instruction, history)response = ""for chunk in generate(prompt, history[-MAX_HISTORY:], temperature=0.7):response += chunk17 unmodified lines"do_sample": True,"seed": seed,}formatted_prompt = format_prompt(f"{prompt}", history)stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)output = ""33 unmodified lines__all__ = ["run_agent","create_interface","format_prompt","generate","MAX_HISTORY","client",29 unmodified lines30313233343536373839404117 unmodified lines5960616263646533 unmodified lines9910010110210310410529 unmodified linesTASK_PROMPT = "task prompt"UNDERSTAND_TEST_RESULTS_PROMPT = "understand test results prompt"def format_prompt_var(message, history):prompt = "\n### Instruction:\n{}\n### History:\n{}".format(message, '\n'.join(history))return promptdef run_agent(instruction, history):prompt = format_prompt_var(instruction, history)response = ""for chunk in generate(prompt, history[-MAX_HISTORY:], temperature=0.7):response += chunk17 unmodified lines"do_sample": True,"seed": seed,}formatted_prompt = format_prompt_var(f"{prompt}", history)stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)output = ""33 unmodified lines__all__ = ["run_agent","create_interface","format_prompt_var","generate","MAX_HISTORY","client",
agent.py+4-4