Simple python interface to access models from Genta API.
Project description
genta-api
Genta Python API Package.
Installation
This API wrapper can be installed by cloning the repository and running pip install . in the root directory. You can also use pip install genta
Examples
You can use this module like so:
from genta_api import GentaAPI
api = GentaAPI(token='your-token')
response, statusCode = api.ChatCompletion(
chat_history=[
{ "role": "user", "text": "Hello, how are you?" },
{ "role": "assistant", "text": "I'm fine, thank you." },
{ "role": "user", "text": "That's good to hear." },
],
model_name='Starstreak',
best_of=1,
decoder_input_details=True,
details=True,
do_sample=True,
max_new_tokens=128,
repetition_penalty=1.03,
return_full_text=False,
seed=None,
stop=[],
temperature=0.7,
top_k=50,
top_n_tokens=None,
top_p=0.95,
truncate=None,
typical_p=0.95,
watermark=False,
)
print(response, statusCode)
A variety of options can be configured when calling the ChatCompletion method:
chat_history: a list of dictionaries, each containing a "role" (user, assistant, or system) and "text".model_name: the name of the machine learning model to use. By default, it uses 'Starstreak'.best_of: an integer specifying the number of responses the model should generate. The best one will be chosen. Default is 1.decoder_input_details,details,do_sample: boolean flags to control various model behaviors.max_new_tokens: the maximum output length that the model will produce.repetition_penalty: a penalty for repetitive output. Default is 1.03.return_full_text: whether the output includes original input text as well. Default is False.seed: an integer to seed random responses.stop: a list of stop tokens.temperature: a measure of randomness in the output.top_k,top_n_tokens,top_p,truncate,typical_p: control parameters for the output.watermark: whether to include a watermark in the output. Default is False.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genta-0.0.3.12.tar.gz.
File metadata
- Download URL: genta-0.0.3.12.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
214825942a7d9016419d4d7855c0661dcbfad53d65f27ca289c1140d716b0643
|
|
| MD5 |
41232e46c1618031e4686535786023a5
|
|
| BLAKE2b-256 |
4e483e88a651a808248e09187c9e1fdcb83c2466037113fcfec55371c449c2a7
|
File details
Details for the file genta-0.0.3.12-py3-none-any.whl.
File metadata
- Download URL: genta-0.0.3.12-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3bef48b88049c7c279a396eadbcf09f9cfb9d1f91741ef7e24de063a9398581
|
|
| MD5 |
95241b899d9bff4b09ca25b2e7adc748
|
|
| BLAKE2b-256 |
e19952db435f4b65e2e2b510c855212529957bea7431548c82545bdde824a476
|