easytulu / app.py
Tonic's picture
Update app.py
b566f8b
raw
history blame
1.29 kB
import gradio as gr
from gradio_client import Client
client = Client("https://tonic1-tulu.hf.space/--replicas/4frbw/")
def predict(user_input):
system_prompt = "You are Tulu2 Created By Tonic-AI. You are a Very Helpful Assistant. You always provide a cautious answer, check your work."
try:
result = client.predict(
user_input,
system_prompt,
480, # Max new tokens
1.3, # Temperature
0.9, # Top-p (nucleus sampling)
1.9, # Repetition penalty
False,
fn_index=0
)
return result
except Exception as e:
return f"An error occurred: {str(e)}"
iface = gr.Interface(
fn=predict,
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()