mirror of https://github.com/InternLM/InternLM
reset IPython
parent
62713e2a83
commit
206c3539dc
|
@ -54,7 +54,7 @@ DEFAULT_PROMPT = (
|
||||||
|
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser(description='Math Code Interpreter')
|
||||||
parser.add_argument('--backend',
|
parser.add_argument('--backend',
|
||||||
type=str,
|
type=str,
|
||||||
default='lmdeploy',
|
default='lmdeploy',
|
||||||
|
@ -572,7 +572,8 @@ def predict(args):
|
||||||
]
|
]
|
||||||
item['pred'].append('😭' if not lang else
|
item['pred'].append('😭' if not lang else
|
||||||
extract_answer(lang[-1]['content']) or '😭')
|
extract_answer(lang[-1]['content']) or '😭')
|
||||||
|
agent._interpreter_executor.actions[
|
||||||
|
'IPythonInteractive'].reset()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
err = str(traceback.format_exc())
|
err = str(traceback.format_exc())
|
||||||
print(f'Error processing index {item["idx"]}: {e}\n{err}')
|
print(f'Error processing index {item["idx"]}: {e}\n{err}')
|
||||||
|
|
Loading…
Reference in New Issue