promptslab / Promptify

Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research
https://discord.gg/m88xfYMbK6
Apache License 2.0
3.21k stars 238 forks source link

Not able to import module #16

Closed shantanuo closed 1 year ago

shantanuo commented 1 year ago

Using ARM processor if that matters:

(base) root@ip-172-31-38-54:/home/ubuntu# python
Python 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 22:25:07)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from promptify import OpenAI
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/miniforge3/lib/python3.7/site-packages/promptify/__init__.py", line 2, in <module>
    from .models.nlp.openai_model import OpenAI
  File "/root/miniforge3/lib/python3.7/site-packages/promptify/models/nlp/openai_model.py", line 6, in <module>
    from .utils import get_encoder
  File "/root/miniforge3/lib/python3.7/site-packages/promptify/models/nlp/utils/__init__.py", line 1, in <module>
    from .bpe_encoder import get_encoder
  File "/root/miniforge3/lib/python3.7/site-packages/promptify/models/nlp/utils/bpe_encoder.py", line 8, in <module>
    from .utils import download
  File "/root/miniforge3/lib/python3.7/site-packages/promptify/models/nlp/utils/utils.py", line 34
    if last_modified := response.headers.get("last-modified"):
                      ^
SyntaxError: invalid syntax
>>>
shantanuo commented 1 year ago

works very well in Google colab. Not sure if my python version is not compatible.

import sys
print(sys.version)

3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]

shantanuo commented 1 year ago

Need to change the file "promptify/models/nlp/utils/utils.py"

        last_modified = response.headers.get("last-modified")
        if last_modified:

created pull request.