Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions conftest.py
Comment thread
little1d marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
Pytest configuration file for SpectrumLab project.
This ensures the spectrumlab module is available for all tests.
"""

import sys
import os
from pathlib import Path

# Add current directory to Python path
current_dir = Path(__file__).parent
sys.path.insert(0, str(current_dir))
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ allow-direct-references = true
[tool.black]
line-length = 120
skip-string-normalization = true

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
18 changes: 18 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Setup script for SpectrumLab package.
This allows the package to be installed in development mode.
"""

from setuptools import setup, find_packages

setup(
name="spectrumlab",
version="0.0.1",
description="Comprehensive toolkit for spectroscopy deep learning",
packages=find_packages(),
install_requires=[
"dotenv>=0.9.9",
"openai>=1.93.0",
],
python_requires=">=3.10",
)
44 changes: 44 additions & 0 deletions spectrumlab/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""
SpectrumLab - Comprehensive toolkit for spectroscopy deep learning.

This package provides tools for dataset loading, training, evaluation,
inference, and more for spectroscopy applications.
"""

__version__ = "0.0.1"
__author__ = "Zhuo Yang, Tianfan Fu"

# Import main modules
from . import models
from . import config
from . import evaluator
from . import benchmark
from . import utils
from . import cli

# Export main classes for convenience
from .models import DeepSeek, GPT4o, InternVL
from .models import Claude_Sonnet_3_5, Claude_Opus_4, Claude_Haiku_3_5, Claude_Sonnet_4
from .models import GPT4_1, GPT4_Vision
from .models import Grok_2_Vision
from .config import Config

__all__ = [
"models",
"config",
"evaluator",
"benchmark",
"utils",
"cli",
"DeepSeek",
"GPT4o",
"InternVL",
"Claude_Sonnet_3_5",
"Claude_Opus_4",
"Claude_Haiku_3_5",
"Claude_Sonnet_4",
"GPT4_1",
"GPT4_Vision",
"Grok_2_Vision",
"Config",
]
32 changes: 32 additions & 0 deletions spectrumlab/config/base_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
# Load .env from project root directory
project_root = Path(__file__).parent.parent.parent
env_path = project_root / ".env"
print(env_path)
load_dotenv(env_path)


@dataclass
class Config:
# This api key is for testing closed MLLMs by Boyue Richdata
BOYUE_API_KEY: str = os.getenv("BOYUE_API_KEY")
BOYUE_BASE_URL: str = os.getenv("BOYUE_BASE_URL")

# DeepSeek API Configuration
deepseek_api_key: str = os.getenv("DEEPSEEK_API_KEY")
deepseek_base_url: str = os.getenv("DEEPSEEK_BASE_URL")
Expand All @@ -25,3 +30,30 @@ class Config:
internvl_api_key: str = os.getenv("INTERNVL_API_KEY")
internvl_base_url: str = os.getenv("INTERNVL_BASE_URL")
internvl_model_name: str = os.getenv("INTERNVL_MODEL_NAME")

# Claude API Configuration
claude_api_key: str = BOYUE_API_KEY
claude_base_url: str = BOYUE_BASE_URL
claude_sonnet_3_5_model_name: str = os.getenv("CLAUDE_SONNET_3_5")
claude_opus_4_model_name: str = os.getenv("CLAUDE_OPUS_4")
claude_haiku_3_5_model_name: str = os.getenv("CLAUDE_HAIKU_3_5")
claude_sonnet_4_model_name: str = os.getenv("CLAUDE_SONNET_4")

# GPT-4.1, GPT-4-Vision
gpt4_1_api_key: str = BOYUE_API_KEY
gpt4_1_base_url: str = BOYUE_BASE_URL
gpt4_1_model_name: str = os.getenv("GPT4_1")
gpt4_vision_api_key: str = BOYUE_API_KEY
gpt4_vision_base_url: str = BOYUE_BASE_URL
gpt4_vision_model_name: str = os.getenv("GPT4_VISION")

# Grok-2-Vision
grok_2_vision_api_key: str = BOYUE_API_KEY
grok_2_vision_base_url: str = BOYUE_BASE_URL
grok_2_vision_model_name: str = os.getenv("GROK_2_VISION")

# Qwen-VL-Max
qwen_vl_api_key: str = BOYUE_API_KEY
qwen_vl_base_url: str = BOYUE_BASE_URL
qwen_vl_model_name: str = os.getenv("QWEN_VL")

7 changes: 6 additions & 1 deletion spectrumlab/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from .deepseek_api import DeepSeek
from .gpt4o_api import GPT4o
from .internvl_api import InternVL
from .claude_api import Claude_Sonnet_3_5, Claude_Opus_4, Claude_Haiku_3_5, Claude_Sonnet_4
from .gpt4_v_api import GPT4_1, GPT4_Vision
from .grok_api import Grok_2_Vision
from .qwen_vl_api import Qwen_VL_Max

__all__ = ["DeepSeek", "GPT4o", "InternVL"]
__all__ = ["DeepSeek", "GPT4o", "InternVL", "Claude_Sonnet_3_5", "Claude_Opus_4",
"Claude_Haiku_3_5", "Claude_Sonnet_4", "GPT4_1", "GPT4_Vision", "Grok_2_Vision", "Qwen_VL_Max"]
Loading