Skip to content

Having trouble using package loading in python version 3.9 #1

@cngvng

Description

@cngvng

After loading in pip, I proceed to import package:

from context_cite import ContextCiter

However, this error tells me that:

`TypeError Traceback (most recent call last)

Cell In[1], [line 3](vscode-notebook-cell:? Execution_count=1&line=3)

[1](vscode-notebook-cell:? Execution_count=1&line=1) from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

----> [3](vscode-notebook-cell:? Execution_count=1&line=3) from context_cite import ContextCiter

File ~/anaconda3/envs/edutex/lib/python3.9/site-packages/context_cite/init.py:1

----> 1 from .context_citer import ContextCiter

3 version = “0.0.1”

4 VERSION = version

File ~/anaconda3/envs/edutex/lib/python3.9/site-packages/context_cite/context_citer.py:24

20 DEFAULT_GENERATE_KWARGS = {"max_new_tokens": 512, "do_sample": False}

21 DEFAULT_PROMPT_TEMPLATE = "Context: {context}\n\nQuery: {query}”

---> 24 class ContextCiter:

25 def init(

26 self,

27 model: Any,

(…)

38 partitioner: Optional[BaseContextPartitioner] = None,

39 ) -> None:

40 “”"

41 Initializes a new instance of the ContextCiter class, which is designed

42 to assist in generating contextualized responses using a given machine

(…)

284 Otherwise, return a stylized dataframe in sorted order.

285 “”"

286 if self.num_sources == 0:

TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and ‘_SpecialForm'`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions