File size: 1,340 Bytes
6305af6 f2cedce 6305af6 f0d19fb f9e7a93 30ebe1b 93ca049 30ebe1b 77ed180 e828597 30ebe1b 7408426 b566f8b 8cc4620 30ebe1b 6305af6 663e20e 6305af6 9ff4cec 8a459a3 6305af6 663e20e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import gradio as gr
from gradio_client import Client
client = Client("https://tonic1-tulu.hf.space/--replicas/j44p9/")
def Tulu(user_input):
system_prompt = "I am 🌷Tulu2 Created By Tonic-AI. I am a Very Helpful Assistant. I always provide a cautious answer and check my work."
try:
result = client.predict(
user_input,
system_prompt,
269, # Max new tokens
0.4, # Temperature
0.9, # Top-p (nucleus sampling)
0.9, # Repetition penalty
False,
fn_index=0,
api_name="tulu"
)
return result
except Exception as e:
return f"An error occurred: {str(e)}"
iface = gr.Interface(
fn=Tulu, # Add the Tulu function here
inputs=gr.Textbox(label="User Input"),
outputs=gr.Textbox(label="Result"),
title="👋🏻👋🏻Welcome to Tonic's 🌷Tulu2EasyChat",
description="This app makes it easy for use [Tulu](https://huggingface.co/allenai/tulu-2-dpo-70b) and also to make a discordbot. Join us on our active [builder's server on discord](https://discord.gg/9XK7zXR7Ke) [add this space as a discord bot on your server](https://discord.com/oauth2/authorize?client_id=1176628808212828231&scope=bot+applications.commands&permissions=326417525824) ."
)
iface.launch() |