Coder Social home page Coder Social logo

chemcrow-public's People

Contributors

doncamilom avatar samcox822 avatar whitead avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chemcrow-public's Issues

Paperscraper not in requirements. LitSearch tool fails

paperscraper is not in requirements, so your sample code fails with:

[/usr/local/lib/python3.10/dist-packages/chemcrow/tools/search.py](https://localhost:8080/#) in <module>
      3 import paperqa
      4 import langchain
----> 5 import paperscraper
      6 from langchain.tools import BaseTool
      7 from langchain import SerpAPIWrapper, OpenAI

ModuleNotFoundError: No module named 'paperscraper'

When installing the latest version, I get:
AttributeError: module 'paperscraper' has no attribute 'search_papers'

What version of paperscraper are you using?

langchain 0.1.x support

Hi. I was wondering if there would be support of langchain 0.1.x versions. I'm trying to launch chemcrow with other langchain agents. Thank you

evaluate code

I read your experimental results in detail, but I didn't find the evaluation part of the code in the code. Can you share it?

RXNRetrosynthesis failing attempts

Hi, thanks for a truly exciting repository.

I have obtained an RXN4CHEM_API_KEY and I am trying to run chemcrow to give suggest a synthesis plan for a given molecule.

However, code fails after multiple attempts:

ReactionRetrosynthesis
Action Input:
CCOC(=O)c1cnc2c(C)cc(C)cc2c1Nc1ccc(OC)c(OC)c1Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 0 of 10
Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 1 of 10
Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 2 of 10
Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 3 of 10
Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 4 of 10
Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 5 of 10
Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 6 of 10
Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 7 of 10
Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 8 of 10
Exception thrown when attempting to run <function RXNRetrosynthesis.predict_retrosynthesis at 0x124731ea0>, attempt 9 of 10
Traceback (most recent call last):
 File "/Users/mduranfrigola/Documents/GitHub/ai-intro-workshop/chemcrowdev.py", line 23, in <module>
  result = mrkl.run(prompt)
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/chemcrow/agents/chemcrow.py", line 84, in run
  outputs = self.agent_executor({"input": prompt})
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/langchain/chains/base.py", line 282, in __call__
  raise e
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/langchain/chains/base.py", line 276, in __call__
  self._call(inputs, run_manager=run_manager)
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/langchain/agents/agent.py", line 1036, in _call
  next_step_output = self._take_next_step(
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/langchain/agents/agent.py", line 891, in _take_next_step
  observation = tool.run(
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/langchain/tools/base.py", line 351, in run
  raise e
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/langchain/tools/base.py", line 325, in run
  else self._run(*tool_args, **tool_kwargs)
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/chemcrow/tools/rxn4chem.py", line 147, in _run
  prediction_id = self.predict_retrosynthesis(target)
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/chemcrow/tools/rxn4chem.py", line 75, in newfn
  return func(*args, **kwargs)
 File "/Users/mduranfrigola/miniconda3/envs/chemcrow/lib/python3.10/site-packages/chemcrow/tools/rxn4chem.py", line 170, in predict_retrosynthesis
  raise KeyError
KeyError

Do you know what may be going on?

Thanks so much in advance.

is self.rephrase_chain used for anything?

the declaration in chemcrow.py

    self.rephrase_chain = chains.LLMChain(prompt=rephrase, llm=self.llm)

don't seem to be ever used for anything. Why is it there?

It actually would be nice to see it used in some fashion to build up a retrying chain.

Wondering if exists token exceed problem

Thanks for ur excellent work, very insightful. But I'm wondering: with 13 tools and local knowledge sources, it seems very easy to reach the 16k token limit(turbo-0613),how to avoid these problems?

Not working with langchain due to changes and migration to langchain experimental

As of today I am using langchain perfectly with other projects. Just testing chemprop minimum script

from chemcrow.agents import ChemCrow

chem_model = ChemCrow(model="gpt-4-0613", temp=0.1, verbose=True)
chem_model.run("What is the molecular weight of tylenol?")

Get the error

/home/stephany/.local/lib/python3.9/site-packages/langchain/__init__.py:34: UserWarning: Importing SerpAPIWrapper from langchain root module is no longer supported. Please use langchain.utilities.SerpAPIWrapper instead.
  warnings.warn(
/home/stephany/.local/lib/python3.9/site-packages/langchain/__init__.py:34: UserWarning: Importing LLMChain from langchain root module is no longer supported. Please use langchain.chains.LLMChain instead.
  warnings.warn(
/home/stephany/.local/lib/python3.9/site-packages/langchain/__init__.py:34: UserWarning: Importing PromptTemplate from langchain root module is no longer supported. Please use langchain.prompts.PromptTemplate instead.
  warnings.warn(
Traceback (most recent call last):
  File "/home/stephany/.local/lib/python3.9/site-packages/chemcrow/agents/chemcrow.py", line 46, in __init__
    self.llm = _make_llm(model, temp, verbose, openai_api_key)
  File "/home/stephany/.local/lib/python3.9/site-packages/chemcrow/agents/chemcrow.py", line 12, in _make_llm
    llm = langchain.chat_models.ChatOpenAI(
  File "/home/stephany/.local/lib/python3.9/site-packages/langchain/load/serializable.py", line 97, in __init__
    super().__init__(**kwargs)
  File "/home/stephany/.local/lib/python3.9/site-packages/pydantic/v1/main.py", line 341, in __init__
    raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for ChatOpenAI
__root__
  Did not find openai_api_key, please add an environment variable `OPENAI_API_KEY` which contains it, or pass  `openai_api_key` as a named parameter. (type=value_error)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stephany/test_query/latest/testing.py", line 3, in <module>
    chem_model = ChemCrow(model="gpt-4-0613", temp=0.1, verbose=True)
  File "/home/stephany/.local/lib/python3.9/site-packages/chemcrow/agents/chemcrow.py", line 48, in __init__
    raise ValueError('Invalid OpenAI API key')
ValueError: Invalid OpenAI API key

Not working due to: No module named 'langchain_core.schema'

Installation and API key setup was done as described in the readme, but when running

from chemcrow.agents import ChemCrow

I am getting the error

ModuleNotFoundError: No module named 'langchain_core.schema'

langchain is installed and version confirmed to be 0.0.275.

Thanks in advance!

Add more tests

We still need tests for the following tools:

  •     ExplosiveCheck,
    
  •     ControlChemCheck,
    
  •     SafetySummary,
    
  •     LitSearch
    

WARNING:paperscraper.load_dumps: No dump found for biorxiv. Skipping entry.

Dear Sir

Upon executing the python test_agent.py command, I encountered the following warnings:

    WARNING:paperscraper.load_dumps: No dump found for biorxiv. Skipping entry.
    WARNING:paperscraper.load_dumps: No dump found for chemrxiv. Skipping entry.
    WARNING:paperscraper.load_dumps: No dump found for medrxiv. Skipping entry.
    WARNING:paperscraper.load_dumps: No dumps found for either biorxiv or medrxiv. Consider using paperscraper.get_dumps.* to fetch the dumps.

Could you please assist me in resolving this issue? It appears that the necessary data dumps are missing, and I am unsure how to proceed with using paperscraper.get_dumps.* to retrieve them.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.