|
|
@ -1,6 +1,8 @@ |
|
|
|
import os |
|
|
|
import os |
|
|
|
import platform |
|
|
|
import platform |
|
|
|
import signal |
|
|
|
import signal |
|
|
|
|
|
|
|
import sys |
|
|
|
|
|
|
|
|
|
|
|
from transformers import AutoTokenizer, AutoModel |
|
|
|
from transformers import AutoTokenizer, AutoModel |
|
|
|
import readline |
|
|
|
import readline |
|
|
|
|
|
|
|
|
|
|
@ -52,13 +54,10 @@ def main(): |
|
|
|
os.system(clear_command) |
|
|
|
os.system(clear_command) |
|
|
|
print(build_prompt(history, prefix), flush=True) |
|
|
|
print(build_prompt(history, prefix), flush=True) |
|
|
|
query = input("\n用户:") |
|
|
|
query = input("\n用户:") |
|
|
|
if query.strip() == "stop": |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
if query.strip() == "clear": |
|
|
|
if query.strip() == "clear": |
|
|
|
history = [] |
|
|
|
break |
|
|
|
os.system(clear_command) |
|
|
|
if query.strip() == "stop": |
|
|
|
print(prefix) |
|
|
|
sys.exit(0) |
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
if __name__ == "__main__": |
|
|
|