File size: 620 Bytes
0496271
 
 
 
 
 
 
 
c26006a
0496271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
34
import os
import gradio as gr
from gradio_client import Client

read_key = os.environ.get('HF_TOKEN', None)

print("gradio version:", gr.__version__)

client = Client("anish-hf-a/ml-test")

def respond(
    message,
    history: list[tuple[str, str]],
    system_message,
    max_tokens,
    temperature,
    top_p,
):

    result = client.predict(
    		message=message,
    		api_name="/chat"
    )
    print(result)
    yield result

"""
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
"""
demo = gr.ChatInterface(
    respond,
)

demo.launch()