- export project-dependent pip
requirement.txt
pip install pipreqs
thenpipreqs path/to/project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# right case | |
[27] | |
given: CC(=O)O.CC(C)=O.CCO.CCOC(=O)C(CCC=C(C)C)C(C)=O.[BH4-].[Na+] | |
pred: CCOC(=O)C(CCC=C(C)C)C(C)O | |
gt: CCOC(=O)C(CCC=C(C)C)C(C)O | |
acc: 1.0 | |
<think> | |
Alright, let's tackle this problem. The user provided a list of reactants and reagents and wants a possible product's SMILES string. Let me see. The reactants are: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this code snippet is taken from the Huggingface implementation of Min P | |
import inspect | |
import math | |
import warnings | |
from typing import Callable, Dict, Iterable, List, Optional, Tuple, Union | |
import numpy as np | |
import torch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
ref https://github.com/bfshi/scaling_on_scales/blob/master/s2wrapper/core.py | |
""" | |
import torch | |
import torch.nn.functional as F | |
import math | |
from einops import rearrange | |
from typing import Callable, List, Tuple, Union |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 从hf-mirror上下载model | |
user="Salesforce" | |
repo="blip2-opt-2.7b" | |
curl "https://hf-mirror.com/${user}/${repo}/tree/main" | grep -o 'href="[^"]*"' | cut -d'"' -f2 | grep "^/${user}/${repo}/blob/main/" | sed "s|^|https://hf-mirror.com|; s|/blob/|/resolve/|g" > files.txt && wget -nc -i files.txt && rm files.txt | |
# 从hf-mirror上下载dataset | |
user="yuvalkirstain" | |
repo="pickapic_v1" | |
curl "https://hf-mirror.com/datasets/${user}/${repo}/tree/main/data" | grep -o 'href="[^"]*"' | cut -d'"' -f2 | grep "^/datasets/${user}/${repo}/blob/main/" | sed "s|^|https://hf-mirror.com|; s|/blob/|/resolve/|g" > files.txt && wget -nc -i files.txt && rm files.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) Meta Platforms, Inc. and affiliates. | |
# All rights reserved. | |
# This source code is licensed under the license found in the | |
# LICENSE file in the root directory of this source tree. | |
# -------------------------------------------------------- | |
# References: | |
# GLIDE: https://github.com/openai/glide-text2im | |
# MAE: https://github.com/facebookresearch/mae/blob/main/models_mae.py | |
# -------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
npm config delete proxy |
- A clear demonstration : Byte-Pair Encoding: Subword-based tokenization algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import contextlib | |
print('Pytorch version\t:', torch.__version__) | |
print('CUDA version\t:', torch.version.cuda) | |
for i in range(torch.cuda.device_count()): | |
print(f'GPU{i}\t\t:',torch.cuda.get_device_name(i)) | |
import os | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simply use peek_model_from_ckpt(CKPT_PATH) | |
""" | |
import torch | |
from typing import Dict | |
class TrieNode: | |
def __init__(self): | |
self.is_end = False | |
self.children = {} |
NewerOlder