diff --git a/environment/frontend_server/translator/views.py b/environment/frontend_server/translator/views.py index bdc666f..b126e06 100644 --- a/environment/frontend_server/translator/views.py +++ b/environment/frontend_server/translator/views.py @@ -20,7 +20,7 @@ from .global_methods import * from .models import * -with open("D:\\Tureco\\SimAIWorld\\environment\\frontend_server\\translator\\name.json", "r", encoding="utf-8") as f: +with open("./translator/name.json", "r", encoding="utf-8") as f: js = f.read() names_mapping = json.loads(js)['persona_names_mapping'] # print(names_mapping) diff --git a/requirements.txt b/requirements.txt index 1500aac..c198eb7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,10 @@ -Django==2.2 -django_storages==1.14 +django_storages googletrans==4.0.0rc1 -gpt4all==1.0.12 +gpt4all litellm==0.1.738 -numpy==1.25.2 openai==0.27.0 python-dotenv==1.0.0 -Requests==2.31.0 -selenium==4.12.0 +selenium tqdm==4.62.3 aiohttp==3.8.3 aiosignal==1.3.1 @@ -29,9 +26,9 @@ exceptiongroup==1.1.0 frozenlist==1.3.3 gensim==3.8.0 gunicorn==20.1.0 -h11==0.14.0 -idna==3.3 -importlib-metadata==4.8.2 +h11 +idna +importlib-metadata jmespath==1.0.1 joblib==1.1.0 kiwisolver==1.3.1 @@ -39,7 +36,6 @@ matplotlib==3.3.4 multidict==6.0.4 nltk==3.6.5 numpy==1.19.5 -openai==0.27.0 outcome==1.2.0 packaging==23.0 pandas==1.1.5 @@ -51,16 +47,14 @@ pyparsing==3.0.6 PySocks==1.7.1 python-dateutil==2.8.2 pytz==2021.3 -regex==2021.11.10 -requests==2.26.0 +regex +requests s3transfer==0.6.0 scikit-learn==0.24.2 scikit-posthocs==0.7.0 scipy==1.5.4 seaborn==0.12.2 -selenium==4.8.2 six==1.16.0 -sklearn==0.0 smart-open==5.2.1 sniffio==1.3.0 sortedcontainers==2.4.0 @@ -71,9 +65,9 @@ tqdm==4.62.3 trio==0.22.0 trio-websocket==0.9.2 trueskill==0.4.5 -typing-extensions==4.0.0 -urllib3==1.26.7 +typing-extensions +urllib3 wsproto==1.2.0 yarl==1.8.2 yellowbrick==1.3.post1 -zipp==3.6.0 +zipp==3.6.0 \ No newline at end of file diff --git a/reverie/backend_server/persona/prompt_template/gpt_structure_local.py b/reverie/backend_server/persona/prompt_template/gpt_structure_local.py index f148eeb..901a58c 100644 --- a/reverie/backend_server/persona/prompt_template/gpt_structure_local.py +++ b/reverie/backend_server/persona/prompt_template/gpt_structure_local.py @@ -268,6 +268,7 @@ def get_embedding(text): text = text.replace("\n", " ") if not text: text = "this is blank" + # gpt4all的更新代码,污染了embedding model的下载路径,需要自行前往https://gpt4all.io/models/gguf/all-MiniLM-L6-v2-f16.gguf 下载到~/.cache/gpt4all/(或自定义model_path) embedder = Embed4All() embedding = embedder.embed(text) return embedding @@ -275,6 +276,7 @@ def get_embedding(text): if __name__ == '__main__': + max_tokens, temperature = 1023, 0.7 gpt_parameter = {"max_tokens": max_tokens, "temperature": temperature, "top_p": 1, "stream": False, "frequency_penalty": 0, "presence_penalty": 0, @@ -283,7 +285,7 @@ def get_embedding(text): prompt_lib_file = "prompt_template/test_prompt_July5.txt" prompt = generate_prompt(curr_input, prompt_lib_file) - def __func_validate(gpt_response): + def __func_validate(gpt_response,prompt=None): if len(gpt_response.strip()) <= 1: return False if len(gpt_response.strip().split(" ")) > 1: diff --git a/reverie/backend_server/reverie.py b/reverie/backend_server/reverie.py index 3aaa054..e2c5f68 100644 --- a/reverie/backend_server/reverie.py +++ b/reverie/backend_server/reverie.py @@ -82,7 +82,7 @@ def __init__(self, # time. This gets incremented by amount everytime the world # progresses (that is, everytime curr_env_file is recieved). self.curr_time = datetime.datetime.strptime(reverie_meta['curr_time'], - "%B %d, %Y, 09:%M:%S") + '%B %d, %Y, %H:%M:%S') # denotes the number of seconds in game time that each # step moves foward. self.sec_per_step = reverie_meta['sec_per_step']