https://github.com/gradio-app/sambanova-gradio

https://github.com/gradio-app/sambanova-gradio

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.2%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: gradio-app
  • Language: Python
  • Default Branch: main
  • Size: 182 KB
Statistics
  • Stars: 21
  • Watchers: 2
  • Forks: 6
  • Open Issues: 1
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme

README.md

sambanova_gradio

is a Python package that makes it very easy for developers to create machine learning apps that are powered by sambanova's Inference API.

Installation

bash pip install sambanova-gradio

That's it!

Basic Usage

Just like if you were to use the sambanova API, you should first save your sambanova API token to this environment variable:

export SAMBANOVA_API_KEY=<your token>

Then in a Python file, write:

```python import gradio as gr import sambanova_gradio

gr.load( name='Meta-Llama-3.1-405B-Instruct', src=sambanova_gradio.registry, ).launch() ```

or simply without setting the environment variable ```

text only chatbot

import gradio as gr import sambanova_gradio

gr.load("Meta-Llama-3.1-70B-Instruct-8k", src=sambanovagradio.registry, accepttoken=True).launch() ```

```

multimodal chatbot

import gradio as gr import sambanova_gradio

gr.load("Llama-3.2-11B-Vision-Instruct", src=sambanovagradio.registry, accepttoken=True, multimodal = True).launch() ```

Run the Python file, and you should see a Gradio Interface connected to the model on sambanova!

ChatInterface

Customization

Once you can create a Gradio UI from a sambanova endpoint, you can customize it by setting your own input and output components, or any other arguments to gr.Interface. For example, the screenshot below was generated with:

```py import gradio as gr import sambanova_gradio

gr.load( name='Meta-Llama-3.1-405B-Instruct', src=sambanova_gradio.registry, title='Sambanova-Gradio Integration', description="Chat with Meta-Llama-3.1-405B-Instruct model.", examples=["Explain quantum gravity to a 5-year old.", "How many R are there in the word Strawberry?"] ).launch() ``` ChatInterface with customizations

Composition

Or use your loaded Interface within larger Gradio Web UIs, e.g.

```python import gradio as gr import sambanova_gradio

with gr.Blocks() as demo: with gr.Tab("405B"): gr.load('Meta-Llama-3.1-405B-Instruct', src=sambanovagradio.registry) with gr.Tab("70B"): gr.load('Meta-Llama-3.1-70B-Instruct-8k', src=sambanovagradio.registry)

demo.launch() ```

Under the Hood

The sambanova-gradio Python library has two dependencies: openai and gradio. It defines a "registry" function sambanova_gradio.registry, which takes in a model name and returns a Gradio app.

Supported Models in Sambanova Cloud

Access Meta’s Llama 3.2 and 3.1 family of models at full precision via the SambaNova Cloud API!

Model details for Llama 3.2 family: 1. Llama 3.2 1B: - Model ID: Meta-Llama-3.2-1B-Instruct - Context length: 4,096 tokens 2. Llama 3.2 3B: - Model ID: Meta-Llama-3.2-3B-Instruct - Context length: 4,096 tokens 3. Llama 3.2 11B Vision: - Model ID: Llama-3.2-11B-Vision-Instruct - Context length: 4096 tokens 4. Llama 3.2 90B Vision: - Model ID: Llama-3.2-90B-Vision-Instruct - Context length: 4096 tokens

Model details for Llama 3.1 family: 1. Llama 3.1 8B: - Model ID: Meta-Llama-3.1-8B-Instruct - Context length: 4k, 8k, 16k 2. Llama 3.1 70B: - Model ID: Meta-Llama-3.1-70B-Instruct - Context length: 4k, 8k, 16k, 32k, 64k 3. Llama 3.1 405B: - Model ID: Meta-Llama-3.1-405B-Instruct - Context length: 4k, 8k


Note: if you are getting a 401 authentication error, then the sambanova API Client is not able to get the API token from the environment variable. This happened to me as well, in which case save it in your Python session, like this:

```py import os

os.environ["SAMBANOVAAPIKEY"] = ... ```

Owner

  • Name: Gradio
  • Login: gradio-app
  • Kind: organization
  • Email: admin@gradio.app
  • Location: Mountain View, CA

Delightfully easy-to-use open-source tools that make machine learning easier and more accessible

GitHub Events

Total
  • Watch event: 20
  • Push event: 4
  • Public event: 1
  • Pull request event: 4
  • Fork event: 6
  • Create event: 2
Last Year
  • Watch event: 20
  • Push event: 4
  • Public event: 1
  • Pull request event: 4
  • Fork event: 6
  • Create event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 14
  • Total Committers: 4
  • Avg Commits per committer: 3.5
  • Development Distribution Score (DDS): 0.571
Past Year
  • Commits: 14
  • Committers: 4
  • Avg Commits per committer: 3.5
  • Development Distribution Score (DDS): 0.571
Top Committers
Name Email Commits
Yuvraj Sharma 4****a@u****m 6
Kaizhao Liang k****9@g****m 4
Abubakar Abid a****r@h****o 2
Petro Junior Milan 1****m@u****m 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 1
  • Total pull requests: 5
  • Average time to close issues: N/A
  • Average time to close pull requests: about 9 hours
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.2
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 5
  • Average time to close issues: N/A
  • Average time to close pull requests: about 9 hours
  • Issue authors: 1
  • Pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.2
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • redhawkeye (1)
Pull Request Authors
  • kyleliang919 (3)
  • snova-petrojm (3)
  • yvrjsharma (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 56 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
  • Total maintainers: 1
pypi.org: sambanova-gradio

A Python package for replicating Gradio applications

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 56 Last month
Rankings
Dependent packages count: 10.2%
Average: 33.9%
Dependent repos count: 57.5%
Maintainers (1)
Last synced: 7 months ago

Dependencies

pyproject.toml pypi
  • gradio *
  • openai *
requirements.txt pypi
  • gradio ==5.0.0b5
  • openai *