Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using Jieba in dify-sandbox: Operation not permitted #97

Open
XiaoLey opened this issue Oct 10, 2024 · 1 comment
Open

Error using Jieba in dify-sandbox: Operation not permitted #97

XiaoLey opened this issue Oct 10, 2024 · 1 comment

Comments

@XiaoLey
Copy link

XiaoLey commented Oct 10, 2024

Hi there! I'm having trouble using the Jieba library for word segmentation in the dify-sandbox environment. When I run the code below, I get the error message: "Building prefix dict from the default dictionary ... error: operation not permitted."

import jieba

def main(input_content: str, reference_cost: int) -> dict:
    words = jieba.lcut(input_content)
    word_count = len(words)

    W_w = 0.005
    real_cost = W_w * word_count

    return {
        "real_cost": real_cost,
    }

It seems like this error is related to permission issues when Jieba tries to build a prefix dictionary from the default dictionary. I'm wondering if there's a way to solve this problem, or if there's an alternative method for word segmentation that works smoothly in dify-sandbox. Additionally, could you provide any solutions or relevant resources to address this issue? Thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants