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

add to qwen reading list #16

Closed
jmanhype opened this issue Oct 4, 2023 · 4 comments
Closed

add to qwen reading list #16

jmanhype opened this issue Oct 4, 2023 · 4 comments
Assignees

Comments

@jmanhype
Copy link

jmanhype commented Oct 4, 2023

not working everytime i add i get this error IndexError: list index out of range

the inference works beteween qwen but its not able to add to reading list or read the list

HELP

@JianxinMa
Copy link
Member

@tuhahaha Let's discuss how we can address this issue when you return from your vacation.

A little more background on the cause of this issue:

When a user clicks the Add button, (1) the URL is saved to a temporary file, and (2) the chatbot will look at that temporary file. The current implementation assumes that Step 1 finishes before Step 2 starts. However, this doesn't always seem to be the case. For example, what if Step 1 is blocked by some other operation? What if the write operation fails? In such scenarios, Step 2 will fail with an IndexError: list index out of range.

@JianxinMa
Copy link
Member

I suspect that the frequent cause of this issue is either one of the following:

  • (More likely) The user is clicking the Add button while having the popup page open. This can lead to a race condition. We need to add some precautions to prevent this.
  • (Less likely) We are having a permission issue when dealing with that temporary file. Perhaps even the directory is not created properly.

@JianxinMa
Copy link
Member

JianxinMa commented Oct 5, 2023

Oh, this is a different issue, not the same one that I am talking about in my previous comment. The IndexError occurs when executing te following code:

...
data['content'] = parse_html_bs(...)  # Using bs4 inside to parse html content received from the chrome extension.
...
extract = data['content'][0]['metadata']['title']  # Here!

@tuhahaha It looks like bs4 fails to retrieve the content of the page here. I'm still trying to reproduce this issue and figure out why it occurs.

@tuhahaha Btw, we need to automatically detect the language and use English prompts when dealing with English requests.

@JianxinMa JianxinMa removed the bug label Oct 5, 2023
@JianxinMa
Copy link
Member

JianxinMa commented Oct 5, 2023

I just pushed a quick fix. Please pull the latest code and see if it works for you.

Details:

  • I managed to reproduce the issue on a Windows machine. WSL2 works fine, but native Windows does not.
  • On my machine, this is related to the str codec, which is a mess on Windows since it does not always use UTF-8 and may instead use other encodings such as GBK or Latin-1.

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

3 participants