mirror of https://github.com/inclusionAI/AReaL
Fix formatting (#90)
This commit is contained in:
parent
de134b4a7a
commit
448bb05a3d
|
@ -14,11 +14,10 @@ from typing import Union
|
|||
|
||||
import regex
|
||||
from latex2sympy2 import latex2sympy
|
||||
from sympy import N, simplify
|
||||
from sympy.parsing.latex import parse_latex
|
||||
from sympy.parsing.sympy_parser import parse_expr
|
||||
|
||||
from sympy import N, simplify
|
||||
|
||||
# from .parser import choice_answer_clean, strip_string
|
||||
# from parser import choice_answer_clean
|
||||
|
||||
|
|
|
@ -3,11 +3,10 @@ import re
|
|||
from typing import Any, Dict, Iterable, List, TypeVar, Union
|
||||
|
||||
import regex
|
||||
import sympy
|
||||
from latex2sympy2 import latex2sympy
|
||||
from word2number import w2n
|
||||
|
||||
import sympy
|
||||
|
||||
# from utils import *
|
||||
|
||||
|
||||
|
|
|
@ -15,11 +15,10 @@ from typing import Union
|
|||
|
||||
import regex
|
||||
from latex2sympy2 import latex2sympy
|
||||
from sympy import N, simplify
|
||||
from sympy.parsing.latex import parse_latex
|
||||
from sympy.parsing.sympy_parser import parse_expr
|
||||
|
||||
from sympy import N, simplify
|
||||
|
||||
# from .parser import choice_answer_clean, strip_string
|
||||
# from parser import choice_answer_clean
|
||||
|
||||
|
|
|
@ -5,11 +5,10 @@ import re
|
|||
from typing import Any, Dict, Iterable, List, TypeVar, Union
|
||||
|
||||
import regex
|
||||
import sympy
|
||||
from latex2sympy2 import latex2sympy
|
||||
from word2number import w2n
|
||||
|
||||
import sympy
|
||||
|
||||
# from utils import *
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
def download_from_huggingface(repo_id: str, filename: str, revision: str = "main", repo_type: str = "dataset") -> str:
|
||||
def download_from_huggingface(
|
||||
repo_id: str, filename: str, revision: str = "main", repo_type: str = "dataset"
|
||||
) -> str:
|
||||
"""
|
||||
Download a file from a HuggingFace Hub repository.
|
||||
"""
|
||||
try:
|
||||
from huggingface_hub import hf_hub_download
|
||||
except ImportError:
|
||||
raise ImportError("Please install huggingface_hub to use this function: pip install huggingface_hub")
|
||||
raise ImportError(
|
||||
"Please install huggingface_hub to use this function: pip install huggingface_hub"
|
||||
)
|
||||
|
||||
return hf_hub_download(
|
||||
repo_id=repo_id,
|
||||
|
@ -20,10 +24,10 @@ def load_hf_or_local_file(path: str) -> str:
|
|||
Load a file from a HuggingFace Hub repository or a local file.
|
||||
hf://<org>/<repo>/<filename>
|
||||
hf://<org>/<repo>@<revision>/<filename>
|
||||
|
||||
e.g,
|
||||
hf-dataset://inclusionAI/AReaL-RL-Data/data/boba_106k_0319.jsonl
|
||||
=>
|
||||
|
||||
e.g,
|
||||
hf-dataset://inclusionAI/AReaL-RL-Data/data/boba_106k_0319.jsonl
|
||||
=>
|
||||
repo_type = dataset
|
||||
repo_id = inclusionAI/AReaL-RL-Data
|
||||
filename = data/boba_106k_0319.jsonl
|
||||
|
@ -40,4 +44,4 @@ def load_hf_or_local_file(path: str) -> str:
|
|||
if "@" in repo_id:
|
||||
repo_id, revision = repo_id.split("@", 1)
|
||||
return download_from_huggingface(repo_id, filename, revision)
|
||||
return path
|
||||
return path
|
||||
|
|
Loading…
Reference in New Issue