Skip to content

Commit

Permalink
Add automatic version bumping
Browse files Browse the repository at this point in the history
  • Loading branch information
macabdul9 committed Dec 19, 2024
1 parent edc6c2f commit 006f03f
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[bumpversion]
current_version = 1.0.1
commit = True
tag = True

[bumpversion:file:setup.py]
18 changes: 14 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Publish to PyPI
on:
push:
branches:
- main # Adjust if your default branch is different
- main

jobs:
publish:
name: Publish Python Package
name: Bump Version and Publish
runs-on: ubuntu-latest

steps:
Expand All @@ -17,12 +17,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
pip install build twine bump2version
- name: Bump version
run: |
bump2version patch
- name: Build package
run: |
Expand All @@ -34,3 +38,9 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*
- name: Push changes back to repository
uses: ad-m/github-push-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,22 @@
- Easy-to-use interface for text generation

## Installation
Ensure you have the required libraries installed:
### Using `pip`
You can install `AnyGen` from PyPI:
```bash
pip install -U anygen
```

### From Source
Clone the repository and install it manually:
```bash
git clone https://github.com/macabdul9/AnyGen.git
cd AnyGen
pip install .
```

### Requirements
Ensure the following libraries are installed:
```bash
pip install transformers google-generativeai requests openai
```
Expand Down Expand Up @@ -81,7 +96,7 @@ Both OpenAI and Gemini models require an API key stored in a JSON file. Below is
`openai_keys.json`:
```json
{
"gpt-4o-miini": {
"gpt-4o-mini": {
"api_key": "your-openai-api-key",
"endpoint": "your_endpoint"
}
Expand All @@ -105,7 +120,7 @@ Both OpenAI and Gemini models require an API key stored in a JSON file. Below is
- `beam_size`: The number of beams to use for beam search.

## Contributions
Feel free to submit issues or contribute to this repository!
Feel free to submit issues and/or contribute to this repository!

## License
This project is licensed under the MIT License.
1 change: 1 addition & 0 deletions anygen/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .anygen import AnyGen
12 changes: 6 additions & 6 deletions tests/test_anygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
from anygen.anygen import AnyGen

def test_anygen():
prompt = "Once upon a time, in a land far away"
prompt = "Write a Python function to calculate the factorial of a number."

# Test Hugging Face Model
# print("Testing Hugging Face Model...")
# hf_model_name = "meta-llama/Llama-3.2-1B-Instruct" # Replace with your Hugging Face model
# hf_generator = AnyGen(model_type="huggingface", model_name_or_path=hf_model_name, device="cpu")
# hf_output = hf_generator.generate(prompt, parameters=None)
# print("Hugging Face Output:", hf_output)
print("Testing Hugging Face Model...")
hf_model_name = "meta-llama/Llama-3.2-1B-Instruct" # Replace with your Hugging Face model
hf_generator = AnyGen(model_type="huggingface", model_name_or_path=hf_model_name, device="cpu")
hf_output = hf_generator.generate(prompt, parameters=None)
print("Hugging Face Output:", hf_output)

# Test OpenAI Model
print("Testing OpenAI Model...")
Expand Down

0 comments on commit 006f03f

Please sign in to comment.