Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,21 @@ import gradio as gr
|
|
| 2 |
import gradio_client
|
| 3 |
from gradio_client import Client
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
with gr.Blocks() as demo:
|
| 10 |
with gr.Row():
|
|
|
|
| 2 |
import gradio_client
|
| 3 |
from gradio_client import Client
|
| 4 |
|
| 5 |
+
title = """# Welcome To Tonic's Easy YI-6B-200K"""
|
| 6 |
+
description = """This is a [connector that looks like open ai](https://huggingface.co/spaces/Tonic1/TonicsYI-6B-200k) on the inputs , then ignores all that and connects to my [YI-6B-200K endpoint](https://huggingface.co/01-ai/Yi-6B-200K). This helps using [Yi for AGI here](https://huggingface.co/spaces/Tonic/AGYIntelligence)"""
|
| 7 |
+
client = Client("https://tonic1-tonicsyi-6b-200k.hf.space/--replicas/cvjqf/")
|
| 8 |
+
def chat_api_interface(messages, model, frequency_penalty=0, logit_bias=None, max_tokens=None, n=1, presence_penalty=0, response_format="text", seed=None, stop=None, stream=False, temperature=0.9, top_p=1, tools=None, tool_choice="none", user=None):
|
| 9 |
+
result = client.predict(
|
| 10 |
+
your_message = messages,
|
| 11 |
+
system_prompt = "I am YiTonic, an AI language model created by Tonic-AI. I am a cautious assistant. I carefully follow instructions. I am helpful and harmless and I follow ethical guidelines and promote positive behavior.",
|
| 12 |
+
max_new_tokens = 16000,
|
| 13 |
+
temperature,
|
| 14 |
+
top_p,
|
| 15 |
+
top_k,
|
| 16 |
+
disable_for_faster_inference,
|
| 17 |
+
api_name="/predict"
|
| 18 |
+
)
|
| 19 |
+
return result
|
| 20 |
|
| 21 |
with gr.Blocks() as demo:
|
| 22 |
with gr.Row():
|