Skip to content

Commit

Permalink
fixing exampels
Browse files Browse the repository at this point in the history
  • Loading branch information
erfanzar committed Nov 4, 2023
1 parent 7e52037 commit c8bd659
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions examples/serving/causal-lm/llama-2-chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,31 +94,6 @@ def load_from_jax(cls, repo_id, checkpoint_path, config_repo=None, config=None):
do_memory_log=False
)

def process_gradio_chat(self, prompt, history, max_new_tokens, greedy, pbar=gr.Progress()):
string = get_prompt_llama2_format(
message=prompt,
chat_history=history,
system_prompt=DEFAULT_SYSTEM_PROMPT
)
response, _ = self.process(
string=string,
greedy=greedy,
max_new_tokens=max_new_tokens,
pbar=pbar
)
history.append([prompt, response])
return '', history

def process_gradio_instruct(self, prompt, system, max_new_tokens, greedy, pbar=gr.Progress()):
string = get_prompt_llama2_format(system_prompt=DEFAULT_SYSTEM_PROMPT, message=prompt, chat_history=[])
response, _ = self.process(
string=string,
greedy=greedy,
max_new_tokens=max_new_tokens,
pbar=pbar
)
return '', response


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Argument parser for Llama2.")
Expand Down

0 comments on commit c8bd659

Please sign in to comment.