Skip to content

Commit

Permalink
Merge pull request #169 from hand-e-fr/dev
Browse files Browse the repository at this point in the history
[MERGE] rc2
  • Loading branch information
WilliamJlvt authored Nov 29, 2024
2 parents deff128 + 531f8bd commit 92a6a1f
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 36 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ If you wish to make changes to the code, please follow these steps:

2. **Clone Your Fork**: Clone your fork locally using the following command:
```sh
git clone https://github.com/your-username/OpenHosta-dev.git
git clone https://github.com/hand-e-fr/OpenHosta.git
```

3. **Create a Branch**: Create a new branch for your feature or bug fix:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OpenHosta
v2.1.0rc-1 - Opensource Project
v2.1.0rc2 - Opensource Project

**- The future of development is human -**

Expand Down Expand Up @@ -31,7 +31,7 @@ pip install OpenHosta
or

```sh
git clone git@github.com:hand-e-fr/OpenHosta.git
git clone https://github.com/hand-e-fr/OpenHosta.git
```

**See the full installation guide [here](docs/installation.md)**
Expand Down
4 changes: 1 addition & 3 deletions RELEASE_NOTE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
## **OpenHosta v2.0.2 - 20/11/24**
## **OpenHosta v2.1.0rc2 - 29/11/24**

- **Fixes**:
- Adding the compatibility for python 3.8, 3.9 and 3.13.
20 changes: 8 additions & 12 deletions docs/doc.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Documentation
___

Documentation for version: **2.0.2**
Documentation for version: **2.1.0rc2**

Welcome to **OpenHosta** documentation :). Here you'll find all the **explanations** you need to understand the library, as well as **usage examples** and advanced **configuration** methods for the most complex tasks. You'll also find explanations of the source code for those interested in **contributing** to this project. Check the [Google Colab](https://colab.research.google.com/drive/1XKrPrhLlYJD-ULTA8WHzIMqTXkb3iIpb?usp=sharing) **test files** to help you take your first steps in discovering OpenHosta.

Expand Down Expand Up @@ -371,9 +371,7 @@ The `predict` function can be used in function or class method by simply returns

- **Linear Regression**: For prediction tasks by simply returns an `int`or a `float` :
```python
from Openhosta import predict, config

config.set_default_apiKey("put-your-api-key-here")
from OpenHosta import predict, config

def example_linear_regression(years : int, profession : str) -> float:
"""
Expand All @@ -386,9 +384,7 @@ The `predict` function can be used in function or class method by simply returns
- **Classification**: For classifying multiple values among predefined categories in a `Literal` from the typing module :
```python
from typing import Literal
from Openhosta import predict, config

config.set_default_apiKey("put-your-api-key-here")
from OpenHosta import predict, config

output = Literal["Good", "Bad"]

Expand Down Expand Up @@ -425,7 +421,7 @@ The `predict` function supports the following parameters:
The `PredictConfig` class provides advanced options for configuring the creation and management of *predict* models. Here’s a detailed breakdown:

```python
from Openhosta import PredictConfig
from OpenHosta import PredictConfig

model_config = PredictConfig(
name="model_test",
Expand Down Expand Up @@ -462,7 +458,7 @@ model_config = PredictConfig(
- `max_tokens` (`int`): Limits the number of words a `str` input can contain, as the model adapts neuron sizes accordingly. Default: `1`.
- **Warning**: Current model architectures do not perform well with natural language processing tasks. For such cases, use the *emulate* feature instead. NLP architecture support is coming soon.
- `dataset_path` (`str`): Provides a custom dataset path. Default: `None`,
- **Warning**: Only `csv` and `jsonl` files are supported for now. For `csv`, please set the prediction columns to `_outputs`. and for `jsonl` please set the last element
- **Warning**: Only `csv` and `jsonl` files are supported for now. Please set the prediction columns to `outputs`.
- `generated_data` (`int`): Specifies the target number of data points for LLM generation (approximate). Default: `100`.

---
Expand All @@ -478,12 +474,12 @@ config_predict = PredictConfig(
name="test_openhosta",
complexity=5,
growth_rate=1.5,
layers_coefficien=100,
coef_layers=100,
normalize=False,
epochs=45,
batch_size=64,
max_tokens=1,
dataset_path="./dataset.csv",
normalize=False
dataset_path="./path_to_your_dataset.csv"
)

# Using the predict function with the configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ All this will be detailed in this document.
1. Clone the Git repository:

```sh
git clone git@github.com:hand-e-fr/OpenHosta.git
git clone https://github.com/hand-e-fr/OpenHosta.git
```

1. Navigate to the directory:
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "OpenHosta"
version = "2.0.2"
version = "2.1.0rc2"
description = "A lightweight library integrating LLM natively into Python"
keywords = ["AI", "GPT", "Natural language", "Autommatic", "Easy"]
authors = [
Expand Down Expand Up @@ -48,7 +48,8 @@ dependencies = [
[project.optional-dependencies]
all = [
"pydantic>=2.9.2",
"torch>=2.5.1"
"torch>=2.5.1",
"numpy>=2.1.3"
]
pydantic = [
"pydantic>=2.8.2"
Expand Down
26 changes: 13 additions & 13 deletions src/OpenHosta/OpenHosta.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
from __future__ import annotations

from .exec.ask import ask
from .core import config
from .core.config import Model, DefaultManager

from .utils.meta_prompt import print_last_prompt
from .utils.import_handler import is_predict
from .utils.meta_prompt import EMULATE_PROMPT

from .exec.ask import ask
from .exec.thinkof import thinkof
from .exec.thought import thought
from .exec.example import example
from .exec.emulate import emulate
from .exec.generate_data import generate_data
from .exec.predict.dataset.dataset import HostaDataset, SourceType
from .core import config
from .core.config import Model, DefaultManager
from .utils.meta_prompt import print_last_prompt

from .exec.predict.predict import predict
from .exec.predict.predict_config import PredictConfig
if is_predict:
from .exec.generate_data import generate_data
from .exec.predict.dataset.dataset import HostaDataset, SourceType
from .exec.predict.predict import predict
from .exec.predict.predict_config import PredictConfig


import os

Expand All @@ -27,13 +32,8 @@
"emulate",
"thought",
"example",
"predict",
"PredictConfig",
"thinkof",
"ask",
"EMULATE_PROMPT",
"print_last_prompt",
"generate_data",
"HostaDataset",
"SourceType"
)
2 changes: 1 addition & 1 deletion src/OpenHosta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .OpenHosta import *

__version__ = "2.0.2"
__version__ = "2.1.0rc2"
10 changes: 9 additions & 1 deletion src/OpenHosta/utils/import_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

all = (
"is_pydantic"
"is_torch"
"is_predict"
)

is_pydantic = False
Expand All @@ -11,3 +11,11 @@
is_pydantic = True
except ImportError:
is_pydantic = False

is_predict = False
try:
import torch
import numpy
is_predict = True
except ImportError:
is_predict = False

0 comments on commit 92a6a1f

Please sign in to comment.