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

UnicodeEncodeError: 'gbk' codec can't encode character '\u2081' in position 7091: illegal multibyte sequence #11

Open
944613709 opened this issue Dec 23, 2024 · 0 comments

Comments

@944613709
Copy link

944613709 commented Dec 23, 2024

Description: I'm encountering the following error when trying to encode a string with the gbk codec:
UnicodeEncodeError: 'gbk' codec can't encode character '\u2081' in position 7091: illegal multibyte sequence
The running log is here
‘File D:\mycoding\python\SciAgentsDiscovery\ScienceDiscovery\utils.py:511, in research_generation(G, embedding_tokenizer, embedding_model, node_embeddings, generate, generate_graph_expansion, randomness_factor, num_random_waypoints, shortest_path, second_hop, data_dir, save_files, verbatim, keyword_1, keyword_2)
508 res_data['synbio_priority'] = synbio_priority
510 output_pdf_path = f"{data_dir}/output_"
--> 511 fname=markdown_to_pdf(complete_doc, output_pdf_path)
513 df = pd.DataFrame([res_data])
514 df_total = pd.concat([df_total, df], ignore_index=True)

File D:\mycoding\python\SciAgentsDiscovery\ScienceDiscovery\utils.py:100, in markdown_to_pdf(markdown_text, output_pdf_path)
98 # Save the Markdown text to a .md file
99 with open(output_md_path, 'w') as md_file:
--> 100 md_file.write(markdown_text)
102 pdfkit.from_string(full_html, output_pdf_path)
104 return output_pdf_path

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

1 participant