ndexbio / gsoc_llm

GSOC 2024 LLM Project
MIT License
0 stars 0 forks source link

Run REACH Locally #23

Closed cannin closed 3 months ago

cannin commented 3 months ago

Prevent the timeouts and re-run extractions on all INDRA dataset sentences not just random.

Favourj-bit commented 3 months ago

@cannin @dexterpratt

I have been able to do this. it is however taking a long time(>30mins) to run even a sample text.

Favourj-bit commented 3 months ago

docker commit CONTAINER_ID reach:favour-0.1

Favourj-bit commented 3 months ago

git clone https://github.com/clulab/reach.git cd reach/docker docker build --tag reach:latest . docker run -d -it -p 8080:8080 reach:latest

Favourj-bit commented 3 months ago

from indra.sources import reach rp = reach.process_text('MEK binds ERK', url=reach.local_text_url)

cannin commented 3 months ago

@Favourj-bit I had issues with Docker. It work just installing the simple dependencies on the command line:

INSTALL

# SBT
brew install sbt

# JAVA
brew install --cask temurin@8

# CHECK VERSIONS 
## MY VERSIONS
user reach % sbt --version
sbt script version: 1.10.1
user reach % java -version
openjdk version "1.8.0_422"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_422-b05)
OpenJDK 64-Bit Server VM (Temurin)(build 25.422-b05, mixed mode)

# JENV FOR MULTIPLE JAVA VERSIONS (ONLY IF NEEDED)
brew install jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(jenv init -)"' >> ~/.zshrc
To have JAVA_HOME get set by jEnv, enable the export plugin. This needs to be done in an initialised shell:

eval "$(jenv init -)"
jenv enable-plugin export

jenv add /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/
jenv local temurin64-1.8.0.422 (OR jenv global temurin64-1.8.0.422)

RUN

# Took maybe ~5 minutes to start after 6MB/s download
sbt "runMain org.clulab.reach.export.server.ApiServer"

In browser go to:

http://localhost:8080 (documentation)

and

http://localhost:8080/api/text?text=Akt1+phosphorylates+TP53 (returns JSON; triggers more downloads 1-2 min)

If above works then try Python code

RESOURCES

Uses 7.84 GB memory, your local computer maybe insufficient to run this and other things smoothly. You might need the server I hope @dexterpratt can provide

Favourj-bit commented 3 months ago

Okay, noted

Favourj-bit commented 3 months ago

@dexterpratt I am running reach locally now